(function(g){var window=this;var aqa=function(a,b){return g.Vb(a,b)},e5=function(){},bqa=function(a){if(a.zc&&"function"==typeof a.zc)return a.zc();
if(g.Fa(a))return a.split("");if(g.Na(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Rb(a)},cqa=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.Na(a)||g.Fa(a))(0,g.z)(a,b,void 0);else{if(a.Hd&&"function"==typeof a.Hd)var c=a.Hd();else if(a.zc&&"function"==typeof a.zc)c=void 0;else if(g.Na(a)||g.Fa(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Sb(a);d=bqa(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},f5=function(a){g.Xm(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.H)()).toString(36));
return a},g5=function(a,b,c){g.Ma(c)||(c=[String(c)]);
g.bn(a.l,b,c)},h5=function(a){return(a=g.vo(a))?new ActiveXObject(a):new XMLHttpRequest},i5=function(a,b){return b+" ["+a.aa+" "+a.D+" "+a.getStatus()+"]"},dqa=function(a){return"content-type"==a.toLowerCase()},j5=function(a){a.g&&a.I&&(a.g.ontimeout=null);
a.F&&(g.v.clearTimeout(a.F),a.F=null)},eqa=function(a){return g.Md&&g.od(9)&&g.Ha(a.timeout)&&g.Ea(a.ontimeout)},k5=function(a){a.O||(a.O=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},l5=function(a,b){if(a.g){j5(a);
var c=a.g,d=a.P[0]?g.Ja:null;a.g=null;a.P=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},m5=function(a,b){a.i=!1;
a.g&&(a.o=!0,a.g.abort(),a.o=!1);a.l=b;a.u=5;k5(a);l5(a)},n5=function(a){return a.g?a.g.readyState:0},o5=function(a){if(a.i&&"undefined"!=typeof g.kY)if(a.P[1]&&4==n5(a)&&2==a.getStatus())i5(a,"Local request error detected and ignored");
else if(a.C&&4==n5(a))g.Hg(a.jw,0,a);else if(a.dispatchEvent("readystatechange"),4==n5(a)){i5(a,"Request complete");a.i=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=g.Tg(1,String(a.D));if(!f&&g.v.self&&g.v.self.location){var k=g.v.self.location.protocol;f=k.substr(0,k.length-1)}e=!fqa.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{a.u=6;try{var l=2<n5(a)?a.g.statusText:""}catch(m){l=""}a.l=l+" ["+a.getStatus()+"]";k5(a)}}finally{l5(a)}}},p5=function(a){g.Tf.call(this);
this.headers=new g.Mm;this.M=a||null;this.i=!1;this.P=this.g=null;this.aa=this.D="";this.u=0;this.l="";this.o=this.W=this.C=this.O=!1;this.A=0;this.F=null;this.Z="";this.I=this.R=!1},q5=function(a){try{return a.g?a.g.responseText:""}catch(b){return""}},gqa=function(a,b){var c=[];
g.Mk(b,function(d){try{var e=g.Ko.prototype.i.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.Ea(e)?g.Jo(e)&&c.push(d):c.push(d)},a);
return c},hqa=function(a,b){var c=gqa(a,b);
(0,g.z)(c,function(d){g.Ko.prototype.remove.call(this,d)},a)},r5=function(a){if(a.dd){if(a.dd.locationOverrideToken)return{locationOverrideToken:a.dd.locationOverrideToken};
if(null!=a.dd.latitudeE7&&null!=a.dd.longitudeE7)return{latitudeE7:a.dd.latitudeE7,longitudeE7:a.dd.longitudeE7}}return null},iqa=function(a,b){g.ab(a,b)||a.push(b)},s5=function(a){var b=0,c;
for(c in a)b++;return b},t5=function(a,b){var c=b instanceof g.yc?b:g.Ec(b,/^data:image\//i.test(b));
a.src=g.zc(c)},jqa=function(a){try{return g.v.JSON.parse(a)}catch(b){}a=String(a);
if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},kqa=function(a,b,c,d){var e=new g.Pm(null,void 0);
a&&g.Qm(e,a);b&&g.Rm(e,b);c&&g.Sm(e,c);d&&(e.i=d);return e},u5=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return jqa(a)},v5=function(){this.g=[];
this.i=[]},w5=function(a,b){g.Pp[a]=!0;
var c=g.Np();c&&c.publish.apply(c,arguments);g.Pp[a]=!1},x5=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.l=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Mm;this.g=this.i="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",lqa(this,a.capabilities||""),mqa(this,a.experiments||""),this.i=a.remoteControllerUrl||"",this.g=a.localChannelEncryptionKey||
"")},lqa=function(a,b){a.capabilities.clear();
(0,g.Yd)(b.split(","),g.Sa(aqa,nqa)).forEach(function(c){a.capabilities.add(c)})},mqa=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},y5=function(a){a=a||{};
this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},z5=function(a,b){return!!b&&(a.id==b||a.uuid==b)},A5=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},oqa=function(a){return new y5(a)},B5=function(a){return g.Ma(a)?(0,g.B)(a,oqa):[]},C5=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},D5=function(a){return g.Ma(a)?"["+(0,g.B)(a,C5).join(",")+"]":"null"},E5=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;
return("x"==a?b:b&3|8).toString(16)})},pqa=function(a){return(0,g.B)(a,function(b){return{key:b.id,
name:b.name}})},F5=function(a,b){return g.Ya(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},G5=function(a,b){return g.Ya(a,function(c){return z5(c,b)})},H5=function(a){try{var b=(0,g.gt)(),c=(0,g.ft)();
b&&b.remove(a);c&&c.remove(a)}catch(d){}},qqa=function(){var a=(0,g.ft)();
a&&hqa(a,a.g.nf(!0))},I5=function(){var a=g.it("yt-remote-connected-devices")||[];
g.rb(a);return a},rqa=function(a){if(0==a.length)return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.B)(a,function(d,e){return 0==e?d:d.substring(c.length)})},J5=function(a){g.ht("yt-remote-connected-devices",a,86400)},L5=function(){if(K5)return K5;
var a=g.it("yt-remote-device-id");a||(a=E5(),g.ht("yt-remote-device-id",a,31536E3));for(var b=I5(),c=1,d=a;g.ab(b,d);)c++,d=a+"#"+c;return K5=d},M5=function(){var a=I5(),b=L5();
g.ab(a,b);g.jt()&&g.tb(a,b);a=rqa(a);if(0==a.length)try{g.js("remote_sid")}catch(c){}else try{g.is("remote_sid",a.join(","),-1)}catch(c){}},N5=function(){return g.it("yt-remote-session-browser-channel")},O5=function(){return g.it("yt-remote-local-screens")||[]},P5=function(){g.ht("yt-remote-lounge-token-expiration",!0,86400)},sqa=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.B)(O5(),function(d){return d.loungeToken}),c=(0,g.B)(a,function(d){return d.loungeToken});
(0,g.kj)(c,function(d){return!g.ab(b,d)})&&P5();
g.ht("yt-remote-local-screens",a,31536E3)},tqa=function(a,b){g.ht("yt-remote-session-browser-channel",a);
g.ht("yt-remote-session-screen-id",b);var c=I5(),d=L5();g.ab(c,d)||c.push(d);J5(c);M5()},Q5=function(a){a||(H5("yt-remote-session-screen-id"),H5("yt-remote-session-video-id"));
M5();a=I5();g.db(a,L5());J5(a)},S5=function(){if(!R5){var a=g.Uo();
a&&(R5=new g.Eo(a))}return R5?!!R5.get("yt-remote-use-staging-server"):!1},T5=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},U5=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},W5=function(a){a.length?V5(a.shift(),function(){W5(a)}):X5()},uqa=function(a){return"chrome-extension://"+a+"/cast_sender.js"},V5=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);d.src=a;(document.head||document.documentElement).appendChild(d)},X5=function(){var a=U5();
a&&a(!1,"No cast extension found")},Y5=function(){if(vqa){var a=2,b=U5(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;V5("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",X5,c)}},wqa=function(){Y5();
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);W5(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},Z5=function(a,b,c){g.D.call(this);
this.A=null!=c?(0,g.x)(a,c):a;this.Wc=b;this.u=(0,g.x)(this.pD,this);this.g=!1;this.i=0;this.l=this.za=null;this.o=[]},$5=function(){},a6=function(a,b,c,d){this.g=a;
this.l=b;this.C=c;this.A=d||1;this.o=45E3;this.ba=new g.cn(this);this.i=new g.Gg;this.i.setInterval(250)},c6=function(a,b,c){a.Yh=1;
a.Zf=f5(b.clone());a.vh=c;a.u=!0;b6(a,null)},d6=function(a,b,c,d,e){a.Yh=1;
a.Zf=f5(b.clone());a.vh=null;a.u=c;e&&(a.fA=!1);b6(a,d)},b6=function(a,b){a.Hi=(0,g.H)();
e6(a);a.Gg=a.Zf.clone();g5(a.Gg,"t",a.A);a.ll=0;a.tc=a.g.Ap(a.g.Tk()?b:null);0<a.eq&&(a.Jn=new g.Cl((0,g.x)(a.nB,a,a.tc),a.eq));a.ba.ca(a.tc,"readystatechange",a.eM);var c=a.eh?g.cc(a.eh):{};a.vh?(a.oo="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.tc.send(a.Gg,a.oo,a.vh,c)):(a.oo="GET",a.fA&&!g.Od&&(c.Connection="close"),a.tc.send(a.Gg,a.oo,null,c));a.g.te(1)},l6=function(a,b,c){for(var d=!0;!a.Rg&&a.ll<c.length;){var e=xqa(a,c);
if(e==f6){4==b&&(a.rg=4,g6(15),d=!1);break}else if(e==h6){a.rg=4;g6(16);d=!1;break}else i6(a,e)}4==b&&0==c.length&&(a.rg=1,g6(17),d=!1);a.xe=a.xe&&d;d||(j6(a),k6(a))},xqa=function(a,b){var c=a.ll,d=b.indexOf("\n",c);
if(-1==d)return f6;c=Number(b.substring(c,d));if(isNaN(c))return h6;d+=1;if(d+c>b.length)return f6;var e=b.substr(d,c);a.ll=d+c;return e},o6=function(a,b){a.Hi=(0,g.H)();
e6(a);var c=b?window.location.hostname:"";a.Gg=a.Zf.clone();g.Xm(a.Gg,"DOMAIN",c);g.Xm(a.Gg,"t",a.A);try{a.Ce=new ActiveXObject("htmlfile")}catch(n){j6(a);a.rg=7;g6(22);k6(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var k=c.charAt(f);if("<"==k)e+="\\x3c";else if(">"==k)e+="\\x3e";else{var l=k;if(l in m6)k=m6[l];else if(l in n6)k=m6[l]=n6[l];else{var m=l.charCodeAt(0);if(31<m&&127>m)k=l;else{if(256>m){if(k="\\x",16>m||256<m)k+="0"}else k="\\u",4096>m&&(k+="0");k+=m.toString(16).toUpperCase()}k=
m6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Sc(g.rc("b/12014412"),d+"</body></html>");a.Ce.open();a.Ce.write(g.Nc(c));a.Ce.close();a.Ce.parentWindow.m=(0,g.x)(a.wL,a);a.Ce.parentWindow.d=(0,g.x)(a.iz,a,!0);a.Ce.parentWindow.rpcClose=(0,g.x)(a.iz,a,!1);c=a.Ce.createElement("DIV");a.Ce.parentWindow.document.body.appendChild(c);d=g.Dc(a.Gg.toString());d=g.Zc(g.Ac(d));d=g.Sc(g.rc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Tc(c,d);a.g.te(1)},e6=function(a){a.lt=(0,g.H)()+a.o;
p6(a,a.o)},p6=function(a,b){if(null!=a.Yi)throw Error("WatchDog timer not null");
a.Yi=q6((0,g.x)(a.GL,a),b)},r6=function(a){a.Yi&&(g.v.clearTimeout(a.Yi),a.Yi=null)},k6=function(a){a.g.hw()||a.Rg||a.g.wn(a)},j6=function(a){r6(a);
g.rf(a.Jn);a.Jn=null;a.i.stop();g.en(a.ba);if(a.tc){var b=a.tc;a.tc=null;b.abort();b.dispose()}a.Ce&&(a.Ce=null)},i6=function(a,b){try{a.g.cz(a,b),a.g.te(4)}catch(c){}},t6=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;s6(a,b,function(k){k?c(!0):g.v.setTimeout(function(){t6(a,b,c,d,f)},f)})}},s6=function(a,b,c){var d=new Image;
d.onload=function(){try{u6(d),c(!0)}catch(e){}};
d.onerror=function(){try{u6(d),c(!1)}catch(e){}};
d.onabort=function(){try{u6(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{u6(d),c(!1)}catch(e){}};
g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
t5(d,a)},u6=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},v6=function(a){this.g=a;
this.i=new $5},x6=function(a){var b=w6(a.g,a.mj,"/mail/images/cleardot.gif");
f5(b);t6(b.toString(),5E3,(0,g.x)(a.vC,a),3,2E3);a.te(1)},z6=function(a){var b=a.g.F;
if(null!=b)g6(5),b?(g6(11),y6(a.g,a,!1)):(g6(12),y6(a.g,a,!0));else if(a.Cd=new a6(a,void 0,void 0,void 0),a.Cd.eh=a.bq,b=a.g,b=w6(b,b.Tk()?a.Uj:null,a.cq),g6(5),!g.Md||g.pd(10))g5(b,"TYPE","xmlhttp"),d6(a.Cd,b,!1,a.Uj,!1);else{g5(b,"TYPE","html");var c=a.Cd;a=!!a.Uj;c.Yh=3;c.Zf=f5(b.clone());o6(c,a)}},A6=function(a,b,c){this.g=1;
this.i=[];this.o=[];this.u=new $5;this.D=a||null;this.F=null!=b?b:null;this.A=c||!1},yqa=function(a,b){this.g=a;
this.map=b;this.context=null},B6=function(a){g.tf.call(this,"statevent",a)},C6=function(a,b){g.tf.call(this,"timingevent",a);
this.size=b},D6=function(a){g.tf.call(this,"serverreachability",a)},H6=function(a){E6(a);
if(3==a.g){var b=a.Bk++,c=a.im.clone();g.Xm(c,"SID",a.l);g.Xm(c,"RID",b);g.Xm(c,"TYPE","terminate");F6(a,c);b=new a6(a,a.l,b,void 0);b.Yh=2;b.Zf=f5(c.clone());t5(new Image,b.Zf.toString());b.Hi=(0,g.H)();e6(b)}G6(a)},J6=function(a){a.OC(1,0);
a.im=w6(a,null,a.Zp);I6(a)},E6=function(a){a.hg&&(a.hg.abort(),a.hg=null);
a.Tb&&(a.Tb.cancel(),a.Tb=null);a.rf&&(g.v.clearTimeout(a.rf),a.rf=null);K6(a);a.yd&&(a.yd.cancel(),a.yd=null);a.ng&&(g.v.clearTimeout(a.ng),a.ng=null)},L6=function(a,b){if(0==a.g)throw Error("Invalid operation: sending map when state is closed");
a.i.push(new yqa(a.MH++,b));2!=a.g&&3!=a.g||I6(a)},I6=function(a){a.yd||a.ng||(a.ng=q6((0,g.x)(a.hz,a),0),a.Sh=0)},O6=function(a,b){if(1==a.g){if(!b){a.Bk=Math.floor(1E5*Math.random());
var c=a.Bk++,d=new a6(a,"",c,void 0);d.eh=null;var e=M6(a),f=a.im.clone();g.Xm(f,"RID",c);g.Xm(f,"CVER","1");F6(a,f);c6(d,f,e);a.yd=d;a.g=2}}else 3==a.g&&(b?N6(a,b):0==a.i.length||a.yd||N6(a))},N6=function(a,b){if(b)if(6<a.Sg){a.i=a.o.concat(a.i);
a.o.length=0;var c=a.Bk-1;var d=M6(a)}else c=b.C,d=b.vh;else c=a.Bk++,d=M6(a);var e=a.im.clone();g.Xm(e,"SID",a.l);g.Xm(e,"RID",c);g.Xm(e,"AID",a.li);F6(a,e);c=new a6(a,a.l,c,a.Sh+1);c.eh=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.yd=c;c6(c,e,d)},F6=function(a,b){if(a.Tc){var c=a.Tc.Hv();
c&&g.Lb(c,function(d,e){g.Xm(b,e,d)})}},M6=function(a){var b=Math.min(a.i.length,1E3),c=["count="+b];
if(6<a.Sg&&0<b){var d=a.i[0].g;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.i[e].g,k=a.i[e].map;f=6>=a.Sg?e:f-d;try{g.Lb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.o=a.o.concat(a.i.splice(0,b));
return c.join("&")},P6=function(a){a.Tb||a.rf||(a.C=1,a.rf=q6((0,g.x)(a.gz,a),0),a.Kh=0)},R6=function(a){if(a.Tb||a.rf||3<=a.Kh)return!1;
a.C++;a.rf=q6((0,g.x)(a.gz,a),Q6(a,a.Kh));a.Kh++;return!0},y6=function(a,b,c){a.mo=c;
a.Ke=b.Bf;a.A||J6(a)},K6=function(a){null!=a.Wg&&(g.v.clearTimeout(a.Wg),a.Wg=null)},Q6=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},T6=function(a,b){if(2==b||9==b){var c=null;
a.Tc&&(c=null);var d=(0,g.x)(a.IM,a);c||(c=new g.Pm("//www.google.com/images/cleardot.gif"),f5(c));s6(c.toString(),1E4,d)}else g6(2);S6(a,b)},S6=function(a,b){a.g=0;
a.Tc&&a.Tc.Ju(b);G6(a);E6(a)},G6=function(a){a.g=0;
a.Ke=-1;if(a.Tc)if(0==a.o.length&&0==a.i.length)a.Tc.mp();else{g.ib(a.o);var b=g.ib(a.i);a.o.length=0;a.i.length=0;a.Tc.mp(b)}},w6=function(a,b,c){var d=g.Ym(c);
if(""!=d.g)b&&g.Rm(d,b+"."+d.g),g.Sm(d,d.u);else{var e=window.location;d=kqa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.zj&&g.Lb(a.zj,function(f,k){g.Xm(d,k,f)});
g.Xm(d,"VER",a.Sg);F6(a,d);return d},q6=function(a,b){if(!g.Oa(a))throw Error("Fn must not be null and must be a function");
return g.v.setTimeout(function(){a()},b)},g6=function(a){U6.dispatchEvent(new B6(U6,a))},V6=function(){},zqa=function(a,b){this.action=a;
this.params=b||{}},W6=function(a,b){g.D.call(this);
this.g=new g.M(this.oL,0,this);g.G(this,this.g);this.Wc=5E3;this.i=0;if(g.Oa(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Oa(a.handleEvent))a=(0,g.x)(a.handleEvent,a);else throw Error("Invalid listener argument");this.l=a},X6=function(a,b,c){this.H=a;
this.A=b;this.l=new g.Do;this.i=new W6(this.nM,this);this.g=null;this.fb=!1;this.u=null;this.F="";this.D=this.o=0;this.C=[];this.I=c||!1},Aqa=function(a){return{firstTestResults:[""],
secondTestResults:!a.g.mo,sessionId:a.g.l,arrayId:a.g.li}},Y6=function(a,b){a.D=b||0;
a.i.stop();a.g&&(3==a.g.g&&O6(a.g),H6(a.g));a.D=0},Z6=function(a){return!!a.g&&3==a.g.g},Bqa=function(a,b){(a.A.loungeIdToken=b)||a.i.stop()},$6=function(a){this.port=this.domain="";
this.g="/api/lounge";this.i=!0;a=a||document.location.href;var b=Number(g.Tg(4,a))||"";b&&(this.port=":"+b);this.domain=g.Ug(a)||"";a=g.Jb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Ib(a,"10.0")&&(this.i=!1))},a7=function(a,b){var c=a.g;
if(g.Ea(void 0)?0:a.i)c="https://"+a.domain+a.port+a.g;return g.dh(c+b,{})},b7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Sa(a.o,d,!0),onError:g.Sa(a.l,e),ie:g.Sa(a.u,e)};c&&(a.ub=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.Hq(b,a)},Cqa=function(){var a=c7;
d7();e7.push(a);f7(e7)},g7=function(a,b){d7();
var c=e7,d=Dqa(a,String(b));0==c.length?Eqa(d):(f7(c),(0,g.z)(c,function(e){e(d)}))},d7=function(){e7||(e7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ia("yt.mdx.remote.debug.handlers_",e7,void 0))},Eqa=function(a){var b=(h7+1)%50;
h7=b;i7[b]=a;j7||(j7=49==b)},f7=function(a){var b=i7;
if(b[0]){var c=h7,d=j7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.z)(a,function(f){f(e)})}while(d!=c);
i7=Array(50);h7=-1;j7=!1}},Dqa=function(a,b){var c=((0,g.H)()-Fqa)/1E3;
c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},k7=function(a){g.P.call(this);
this.C=a;this.g=[]},l7=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.g.push(b);return!0},Gqa=function(a,b){var c=a.g.length!=b.length;
a.g=(0,g.Yd)(a.g,function(f){return!!F5(b,f)});
for(var d=0,e=b.length;d<e;d++)c=l7(a,b[d])||c;return c},Hqa=function(a,b){var c=a.g.length;
a.g=(0,g.Yd)(a.g,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.g.length<c},m7=function(a,b,c,d){g.P.call(this);
this.A=a;this.u=b;this.l=c;this.o=d;this.i=0;this.g=null;this.za=NaN},o7=function(a){k7.call(this,"LocalScreenService");
this.l=a;this.i=NaN;n7(this);this.info("Initializing with "+D5(this.g))},p7=function(a){if(a.g.length){var b=(0,g.B)(a.g,function(d){return d.id}),c=a7(a.l,"/pairing/get_lounge_token_batch");
b7(a.l,c,{screen_ids:b.join(",")},(0,g.x)(a.zD,a),(0,g.x)(a.yD,a))}},n7=function(a){var b=B5(O5());
b=(0,g.Yd)(b,function(c){return!c.uuid});
return Gqa(a,b)},q7=function(a,b){sqa((0,g.B)(a.g,A5));
b&&P5()},s7=function(a,b){g.P.call(this);
this.A=b;var c=g.it("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.A(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.ab(c,l)}this.g=d;this.u=a;this.l=this.o=NaN;this.i=null;r7("Initialized with "+g.Lg(this.g))},t7=function(a,b,c){var d=a7(a.u,"/pairing/get_screen_availability");
b7(a.u,d,{lounge_token:b.token},(0,g.x)(function(e){e=e.screens||[];for(var f=0,k=e.length;f<k;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.x)(function(){c(!1)},a))},u7=function(a,b){a:if(s5(b)!=s5(a.g))var c=!1;
else{c=g.Sb(b);for(var d=0,e=c.length;d<e;++d)if(!a.g[c[d]]){c=!1;break a}c=!0}c||(r7("Updated online screens: "+g.Lg(a.g)),a.g=b,a.N("screenChange"));Iqa(a)},v7=function(a){isNaN(a.l)||g.Mp(a.l);
a.l=g.Kp((0,g.x)(a.rs,a),0<a.o&&a.o<(0,g.H)()?2E4:1E4)},r7=function(a){g7("OnlineScreenService",a)},w7=function(a){var b={};
(0,g.z)(a.A(),function(c){c.token?b[c.token]=c.id:this.Hb("Requesting availability of screen w/o lounge token.")});
return b},Iqa=function(a){a=g.Sb(g.Mb(a.g,function(b){return b}));
g.rb(a);a.length?g.ht("yt-remote-online-screen-ids",a.join(","),60):H5("yt-remote-online-screen-ids")},x7=function(a){k7.call(this,"ScreenService");
this.A=a;this.i=this.l=null;this.o=[];this.u={};Jqa(this)},z7=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.u[b]);var k=a.Id();if(k=(c?G5(k,c):null)||G5(k,b)){k.uuid=b;var l=y7(a,k);t7(a.i,l,function(m){e(m?l:null)})}else c?Kqa(a,c,(0,g.x)(function(m){var n=y7(this,new y5({name:d,
screenId:c,loungeToken:m,dialId:b||""}));t7(this.i,n,function(p){e(p?n:null)})},a),f):e(null)},A7=function(a,b){for(var c=0,d=a.g.length;c<d;++c)if(a.g[c].name==b)return a.g[c];
return null},Kqa=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={ub:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,k){var l=k&&k.screens||[];l[0]&&l[0].screenId==b?c(l[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.Hq(a7(a.A,"/pairing/get_lounge_token_batch"),e)},B7=function(a){a.g=a.l.Id();
var b=a.u,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.g.length;b<d;++b){var e=a.g[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+D5(a.g))},Jqa=function(a){C7(a);
a.l=new o7(a.A);a.l.subscribe("screenChange",(0,g.x)(a.HD,a));B7(a);a.o=B5(g.it("yt-remote-automatic-screen-cache")||[]);C7(a);a.info("Initializing automatic screens: "+D5(a.o));a.i=new s7(a.A,(0,g.x)(a.Id,a,!0));a.i.subscribe("screenChange",(0,g.x)(function(){this.N("onlineScreenChange")},a))},y7=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=G5(a.o,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.o.push(b),g.ht("yt-remote-automatic-screen-cache",(0,g.B)(a.o,A5)));C7(a);a.u[b.uuid]=b.id;g.ht("yt-remote-device-id-map",a.u,31536E3);return b},C7=function(a){a.u=g.it("yt-remote-device-id-map")||{}},D7=function(a,b,c){g.P.call(this);
this.P=c;this.F=a;this.i=b;this.l=null},E7=function(a,b){g7(a.P,b)},G7=function(a,b){D7.call(this,a,b,"CastSession");
this.g=null;this.o=0;this.A=(0,g.x)(this.nN,this);this.u=(0,g.x)(this.RL,this);this.o=g.Kp((0,g.x)(function(){F7(this,null)},this),12E4)},Lqa=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Lg(void 0));
var b={type:"getMdxSessionStatus"};a.g?a.g.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ja,(0,g.x)(function(){E7(this,"Failed to send message: getMdxSessionStatus.")},a)):E7(a,"Sending yt message without session: "+g.Lg(b))},F7=function(a,b){g.Mp(a.o);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.l||a.l.id!=b){var c=(0,g.x)(a.yn,a),d=(0,g.x)(a.Md,a);a.Xv(b,c,d,5)}}else a.Md(Error("Waiting for session status timed out."))},H7=function(a,b,c){D7.call(this,a,b,"DialSession");
this.o=this.D=null;this.H="";this.M=c;this.u=null;this.C=g.Ja;this.A=NaN;this.I=(0,g.x)(this.qN,this);this.g=g.Ja},I7=function(a){a.g=a.F.sB(a.H,a.i.label,a.i.friendlyName,(0,g.x)(function(b){this.g=g.Ja;
this.yn(b)},a),(0,g.x)(function(b){this.g=g.Ja;
this.Md(b)},a))},J7=function(a){var b={};
b.pairingCode=a.H;b.theme=a.M;if(a.u){var c=a.u.currentTime||0;b.v=a.u.videoId;b.t=c}S5()&&(b.env_useStageMdx=1);return g.bh(b)},K7=function(a,b){D7.call(this,a,b,"ManualSession");
this.g=g.Kp((0,g.x)(this.ni,this,null),150)},L7=function(a,b,c,d){g.P.call(this);
this.i=a;this.C=b||"233637DE";this.A=c||"cl";this.D=d||!1;this.g=null;this.u=!1;this.l=[];this.o=(0,g.x)(this.xK,this)},M7=function(a,b){return b?g.Ya(a.l,function(c){return z5(b,c.label)},a):null},N7=function(a){g7("Controller",a)},c7=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},O7=function(a){return a.u||!!a.l.length||!!a.g},P7=function(a,b,c){b!=a.g&&(g.rf(a.g),(a.g=b)?(c?a.N("yt-remote-cast2-receiver-resumed",b.i):a.N("yt-remote-cast2-receiver-selected",
b.i),b.subscribe("sessionScreen",(0,g.x)(a.fz,a,b)),b.l?a.N("yt-remote-cast2-session-change",b.l):c&&a.g.ni(null)):a.N("yt-remote-cast2-session-change",null))},Q7=function(a){var b=a.i.rB(),c=a.g&&a.g.i;
a=(0,g.B)(b,function(d){c&&z5(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=M7(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a);
c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},Pqa=function(a,b,c,d,e,f,k){Mqa()?Nqa(b,e,f,k)&&(S7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?T7(a,c):(window.__onGCastApiAvailable=function(l,m){l?T7(a,c):(U7("Failed to load cast API: "+m),V7(!1),S7(!1),H5("yt-remote-cast-available"),H5("yt-remote-cast-receiver"),W7(),c(!1))},d?g.Xp("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):
0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?wqa():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?X5():(Y5(),W5(Oqa.map(uqa))))):R7("Cannot initialize because not running Chrome")},W7=function(){R7("dispose");
var a=X7();a&&a.dispose();g.Ia("yt.mdx.remote.cloudview.instance_",null,void 0);Y7(!1);g.Sp(Z7);Z7.length=0},$7=function(){return!!g.it("yt-remote-cast-installed")},a8=function(){var a=g.it("yt-remote-cast-receiver");
return a?a.friendlyName:null},b8=function(){R7("clearCurrentReceiver");
H5("yt-remote-cast-receiver")},c8=function(){return $7()?X7()?X7().getCastSession():(U7("getCastSelector: Cast is not initialized."),null):(U7("getCastSelector: Cast API is not installed!"),null)},e8=function(){$7()?X7()?d8()?(R7("Requesting cast selector."),X7().requestSession()):(R7("Wait for cast API to be ready to request the session."),Z7.push(g.Rp("yt-remote-cast2-api-ready",e8))):U7("requestCastSelector: Cast is not initialized."):U7("requestCastSelector: Cast API is not installed!")},f8=function(a,
b){d8()?X7().setConnectedScreenStatus(a,b):U7("setConnectedScreenStatus called before ready.")},Mqa=function(){var a=0<=g.Jb.search(/ (CrMo|Chrome|CriOS)\//);
return g.Qw||a},Qqa=function(a,b){X7().init(a,b)},Nqa=function(a,b,c,d){var e=!1;
X7()||(a=new L7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.ht("yt-remote-cast-available",f);w5("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){R7("onReceiverSelected: "+f.friendlyName);
g.ht("yt-remote-cast-receiver",f);w5("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){R7("onReceiverResumed: "+f.friendlyName);
g.ht("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){R7("onSessionChange: "+C5(f));
f||H5("yt-remote-cast-receiver");w5("yt-remote-cast2-session-change",f)}),g.Ia("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
R7("cloudview.createSingleton_: "+e);return e},X7=function(){return g.w("yt.mdx.remote.cloudview.instance_")},T7=function(a,b){V7(!0);
S7(!1);Qqa(a,function(c){c?(Y7(!0),g.Up("yt-remote-cast2-api-ready")):(U7("Failed to initialize cast API."),V7(!1),H5("yt-remote-cast-available"),H5("yt-remote-cast-receiver"),W7());b(c)})},R7=function(a){g7("cloudview",a)},U7=function(a){g7("cloudview",a)},V7=function(a){R7("setCastInstalled_ "+a);
g.ht("yt-remote-cast-installed",a)},d8=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},Y7=function(a){R7("setApiReady_ "+a);
g.Ia("yt.mdx.remote.cloudview.apiReady_",a,void 0)},S7=function(a){g.Ia("yt.mdx.remote.cloudview.initializing_",a,void 0)},g8=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.A=this.C=0;this.g=null;this.hasNext=this.Le=!1;this.F=this.D=this.i=this.o=0;this.l=NaN;this.u=!1;this.reset(a)},h8=function(a){a.audioTrackId=null;
a.g=null;a.playerState=-1;a.Le=!1;a.hasNext=!1;a.C=0;a.A=(0,g.H)();a.o=0;a.i=0;a.D=0;a.F=0;a.l=NaN;a.u=!1},i8=function(a){return 1==a.playerState?((0,g.H)()-a.A)/1E3:0},j8=function(a,b){a.C=b;
a.A=(0,g.H)()},k8=function(a){switch(a.playerState){case 1:case 1081:return((0,g.H)()-a.A)/1E3+a.C;
case -1E3:return 0}return a.C},l8=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&h8(a)},m8=function(a){var b={};
b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.dc(a.g);b.hasPrevious=a.Le;b.hasNext=a.hasNext;b.playerTime=a.C;b.playerTimeAt=a.A;b.seekableStart=a.o;b.seekableEnd=a.i;b.duration=a.D;b.loadedTime=a.F;b.liveIngestionTime=a.l;return b},p8=function(a,b){g.P.call(this);
this.g=0;this.o=a;this.A=[];this.u=new v5;this.l=this.i=null;this.F=(0,g.x)(this.uI,this);this.C=(0,g.x)(this.Ek,this);this.D=(0,g.x)(this.tI,this);this.H=(0,g.x)(this.II,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.ot,this),n8(this))):c=3;0!=c&&(b?this.ot(c):g.Kp((0,g.x)(function(){this.ot(c)},this),0));
var d=c8();d&&o8(this,d);this.subscribe("yt-remote-cast2-session-change",this.H)},q8=function(a){return new g8(a.o.getPlayerContextData())},n8=function(a){(0,g.z)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.A.push(this.o.subscribe(b,g.Sa(this.uK,b),this))},a)},r8=function(a){(0,g.z)(a.A,function(b){this.o.unsubscribeByKey(b)},a);
a.A.length=0},s8=function(a,b){var c=a.u;
50>c.g.length+c.i.length&&a.u.i.push(b)},u8=function(a,b,c){var d=q8(a);
j8(d,c);-1E3!=d.playerState&&(d.playerState=b);t8(a,d)},v8=function(a,b,c){a.o.sendMessage(b,c)},t8=function(a,b){r8(a);
a.o.setPlayerContextData(m8(b));n8(a)},o8=function(a,b){a.l&&(a.l.removeUpdateListener(a.F),a.l.removeMediaListener(a.C),a.Ek(null));
a.l=b;a.l&&(g7("CP","Setting cast session: "+a.l.sessionId),a.l.addUpdateListener(a.F),a.l.addMediaListener(a.C),a.l.media.length&&a.Ek(a.l.media[0]))},w8=function(a){var b=a.i.media,c=a.i.customData;
if(b&&c){var d=q8(a);b.contentId!=d.videoId&&g7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;j8(d,a.i.getEstimatedTime());t8(a,d)}else g7("CP","No cast media video. Ignoring state update.")},x8=function(a,b,c){return(0,g.x)(function(d){this.Hb("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Hb("Retrying "+b+" using MDx browser channel."),v8(this,b,c))},a)},y8=function(a,b,c){g.P.call(this);
this.u=NaN;this.I=!1;this.D=this.C=this.F=this.H=NaN;this.P=[];this.o=this.A=this.l=this.Na=this.g=null;this.O=a;this.P.push(g.Pr(window,"beforeunload",(0,g.x)(this.sD,this)));this.i=[];this.Na=new g8;this.M=b.id;this.g=Rqa(this,c);this.g.subscribe("handlerOpened",this.yI,this);this.g.subscribe("handlerClosed",this.vI,this);this.g.subscribe("handlerError",this.wI,this);this.g.subscribe("handlerMessage",this.xI,this);Bqa(this.g,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Na.videoId;
g.jt()&&g.ht("yt-remote-session-video-id",d)},this)},z8=function(a){g7("conn",a)},Rqa=function(a,b){return new X6(a7(a.O,"/bc"),b)},A8=function(a,b){a.N("proxyStateChange",b)},Sqa=function(a){a.u=g.Kp((0,g.x)(function(){z8("Connecting timeout");
this.Ph(1)},a),2E4)},B8=function(a){g.Mp(a.u);
a.u=NaN},C8=function(a){g.Mp(a.H);
a.H=NaN},Tqa=function(a){D8(a);
a.F=g.Kp((0,g.x)(function(){E8(this,"getNowPlaying")},a),2E4)},D8=function(a){g.Mp(a.F);
a.F=NaN},G8=function(a,b){b&&(B8(a),C8(a));
b==(Z6(a.g)&&isNaN(a.u))?b&&(A8(a,1),E8(a,"getSubtitlesTrack")):b?(a.Uv()&&a.Na.reset(),A8(a,1),E8(a,"getNowPlaying"),F8(a)):a.Ph(1)},Uqa=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Na.videoId&&(g.Yb(b.params)?a.Na.g=null:a.Na.g=b.params,a.N("remotePlayerChange"))},H8=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.Na.listId=b.params.listId||a.Na.listId;l8(a.Na,c,d);a.N("remoteQueueChange")},Vqa=function(a,b){b.params=b.params||{};
H8(a,b);I8(a,b);a.N("autoplayDismissed")},I8=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
j8(a.Na,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Na.playerState&&(c=-1E3);a.Na.playerState=c;c=Number(b.params.loadedTime);a.Na.F=isNaN(c)?0:c;c=Number(b.params.duration);a.Na.D=isNaN(c)?0:c;c=a.Na;var d=Number(b.params.liveIngestionTime);c.l=d;c.u=isNaN(d)?!1:!0;c=a.Na;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.o=isNaN(d)?0:d;c.i=isNaN(e)?0:e;1==a.Na.playerState?Tqa(a):D8(a);a.N("remotePlayerChange")},Wqa=function(a,b){if(-1E3!=
a.Na.playerState){var c=1085;
switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.Na.playerState=c;c=parseInt(b.params.currentTime,10);j8(a.Na,isNaN(c)?0:c);a.N("remotePlayerChange")}},Xqa=function(a,b){var c="true"==b.params.muted;
a.Na.volume=parseInt(b.params.volume,10);a.Na.muted=c;a.N("remotePlayerChange")},Yqa=function(a,b){a.A=b.params.videoId;
a.N("nowAutoplaying",parseInt(b.params.timeout,10))},Zqa=function(a,b){var c="true"==b.params.hasNext;
a.Na.Le="true"==b.params.hasPrevious;a.Na.hasNext=c;a.N("previousNextChange")},F8=function(a){g.Mp(a.D);
a.D=g.Kp((0,g.x)(a.Ph,a,1),864E5)},E8=function(a,b,c){c?z8("Sending: action="+b+", params="+g.Lg(c)):z8("Sending: action="+b);
a.g.sendMessage(b,c)},J8=function(a){k7.call(this,"ScreenServiceProxy");
this.Vc=a;this.i=[];this.i.push(this.Vc.$_s("screenChange",(0,g.x)(this.lN,this)));this.i.push(this.Vc.$_s("onlineScreenChange",(0,g.x)(this.ZJ,this)))},dra=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.Cp("MDX_CONFIG")||b;qqa();M5();K8||(K8=new $6(b?b.loungeApiHost:void 0),S5()&&(K8.g="/api/loungedev"));L8||(L8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ia("yt.mdx.remote.deferredProxies_",L8,void 0));$qa();var c=M8();if(!c){var d=new x7(K8);g.Ia("yt.mdx.remote.screenService_",d,void 0);c=M8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);Pqa(a,d,function(m){m?N8()&&f8(N8(),"YouTube TV"):d.subscribe("onlineScreenChange",
function(){w5("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Ia("yt.mdx.remote.initialized_",!0,void 0),O8("Initializing: "+g.Lg(b)),P8.push(g.Rp("yt-remote-cast2-availability-change",function(){w5("yt-remote-receiver-availability-change")})),P8.push(g.Rp("yt-remote-cast2-receiver-selected",function(){Q8(null);
w5("yt-remote-auto-connect","cast-selector-receiver")})),P8.push(g.Rp("yt-remote-cast2-receiver-resumed",function(){w5("yt-remote-receiver-resumed","cast-selector-receiver")})),P8.push(g.Rp("yt-remote-cast2-session-change",ara)),P8.push(g.Rp("yt-remote-connection-change",function(m){m?f8(N8(),"YouTube TV"):R8()||(f8(null,null),b8())})),a=S8(),b.isAuto&&(a.id+="#dial"),g.yq("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),O8(" -- with channel params: "+
g.Lg(a)),bra(a),c.start(),N8()||cra())},era=function(){var a=T8();
$7()&&g.it("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},T8=function(){var a=M8().Vc.$_gos();
var b=U8();b&&V8()&&(F5(a,b)||a.push(b));return pqa(a)},W8=function(){var a=fra();
!a&&$7()&&a8()&&(a={key:"cast-selector-receiver",name:a8()});return a},fra=function(){var a=T8(),b=U8();
b||(b=R8());return g.Ya(a,function(c){return b&&z5(b,c.key)?!0:!1})},U8=function(){var a=N8();
if(!a)return null;var b=M8().Id();return G5(b,a)},ara=function(a){O8("remote.onCastSessionChange_: "+C5(a));
if(a){var b=U8();b&&b.id==a.id?f8(b.id,"YouTube TV"):(b&&X8(),Y8(a,1))}else V8()&&X8()},X8=function(){d8()?X7().stopSession():U7("stopSession called before API ready.");
var a=V8();a&&(a.disconnect(1),Z8(null))},$8=function(){var a=V8();
return!!a&&3!=a.getProxyState()},O8=function(a){g7("remote",a)},M8=function(){if(!a9){var a=g.w("yt.mdx.remote.screenService_");
a9=a?new J8(a):null}return a9},N8=function(){return g.w("yt.mdx.remote.currentScreenId_")},b9=function(a){g.Ia("yt.mdx.remote.currentScreenId_",a,void 0)},c9=function(){return g.w("yt.mdx.remote.connectData_")},Q8=function(a){g.Ia("yt.mdx.remote.connectData_",a,void 0)},V8=function(){return g.w("yt.mdx.remote.connection_")},Z8=function(a){var b=V8();
Q8(null);a||b9("");g.Ia("yt.mdx.remote.connection_",a,void 0);L8&&((0,g.z)(L8,function(c){c(a)}),L8.length=0);
b&&!a?w5("yt-remote-connection-change",!1):!b&&a&&w5("yt-remote-connection-change",!0)},R8=function(){var a=g.jt();
if(!a)return null;var b=M8().Id();return G5(b,a)},Y8=function(a,b){U8()&&U8();
if(d9)e9=a;else{b9(a.id);var c=new y8(K8,a,S8());c.connect(b,c9());c.subscribe("beforeDisconnect",function(d){w5("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){V8()&&Z8(null)});
Z8(c)}},cra=function(){var a=R8();
a?(O8("Resume connection to: "+C5(a)),Y8(a,0)):(Q5(),b8(),O8("Skipping connecting because no session screen found."))},$qa=function(){var a=S8();
if(g.Yb(a)){a=L5();var b=g.it("yt-remote-session-name")||"",c=g.it("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ia("yt.mdx.remote.channelParams_",a,void 0)}},S8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},bra=function(a){a?(g.ht("yt-remote-session-app",a.app),g.ht("yt-remote-session-name",a.name)):(H5("yt-remote-session-app"),H5("yt-remote-session-name"));
g.Ia("yt.mdx.remote.channelParams_",a,void 0)},f9=function(a,b,c){g.D.call(this);
this.u=a;this.i=b;this.l=new g.xs(this);g.G(this,this.l);this.l.K(b,"onCaptionsTrackListChanged",this.tJ);this.l.K(b,"captionschanged",this.sI);this.l.K(b,"captionssettingschanged",this.FA);this.l.K(b,"videoplayerreset",this.zn);this.l.K(b,"mdxautoplaycancel",this.uC);this.O=this.l.K(b,"onVolumeChange",this.Qy);this.D=!1;this.g=c;c.subscribe("proxyStateChange",this.bz,this);c.subscribe("remotePlayerChange",this.Gk,this);c.subscribe("remoteQueueChange",this.zn,this);c.subscribe("autoplayUpNext",this.Fy,
this);c.subscribe("previousNextChange",this.Yy,this);c.subscribe("nowAutoplaying",this.Uy,this);c.subscribe("autoplayDismissed",this.Ey,this);this.suggestion=null;this.F=new g.kC(64);this.o=new g.M(this.DA,500,this);g.G(this,this.o);this.A=new g.M(this.EA,1E3,this);g.G(this,this.A);this.I=new Z5(this.SM,0,this);g.G(this,this.I);this.C={};this.P=new g.M(this.eB,1E3,this);g.G(this,this.P);this.H=new g.Cl(this.PF,1E3,this);g.G(this,this.H);this.M=g.Ja;this.FA();this.zn();this.Gk()},g9=function(a,b){a.u.Kc(b,
a.i.getVideoData().lengthSeconds)},i9=function(a){g9(a,0);
a.o.stop();h9(a,new g.kC(64))},k9=function(a,b){if(j9(a)&&!a.D){var c=null;
b&&(c={style:a.i.getSubtitlesUserSettings()},g.fc(c,b));a.g.sA(a.i.getVideoData(1).videoId,c);a.C=q8(a.g).g}},l9=function(a,b){var c=a.i.getPlaylist();
if(c){var d=c.Sa;var e=c.listId.toString()}c=a.i.getVideoData(1);a.g.playVideo(c.videoId,b,d,e,c.playerParams,c.Ef,r5(c));h9(a,new g.kC(1))},m9=function(a,b){if(b){var c=a.i.getOption("captions","tracklist",{GQ:1});
c&&c.length?(a.i.setOption("captions","track",b),a.D=!1):(a.i.loadModule("captions"),a.D=!0)}else a.i.setOption("captions","track",{})},j9=function(a){return q8(a.g).videoId==a.i.getVideoData(1).videoId},h9=function(a,b){a.A.stop();
var c=a.F;if(!g.qC(c,b)){var d=g.U(b,2);d!=g.U(a.F,2)&&g.cK(a.i,d);a.F=b;n9(a.u,c,b)}},o9=function(){g.W.call(this,{B:"div",
G:"ytp-mdx-popup-dialog",L:{role:"dialog"},J:[{B:"div",G:"ytp-mdx-popup-dialog-inner-content",J:[{B:"div",G:"ytp-mdx-popup-title",T:"No has iniciado sesi\u00f3n"},{B:"div",G:"ytp-mdx-popup-description",T:"Los v\u00eddeos que veas podr\u00edan aparecer en el historial de reproducciones de la TV e influir en las recomendaciones. Puedes evitarlo si cancelas e inicias sesi\u00f3n en YouTube desde tu ordenador."},{B:"div",G:"ytp-mdx-privacy-popup-buttons",J:[{B:"button",V:["ytp-button","ytp-mdx-privacy-popup-cancel"],
T:"Cancelar"},{B:"button",V:["ytp-button","ytp-mdx-privacy-popup-confirm"],T:"Confirmar"}]}]}]});this.l=new g.WP(this,250);g.G(this,this.l);this.C=this.i["ytp-mdx-privacy-popup-cancel"];this.K(this.C,"click",this.o);this.u=this.i["ytp-mdx-privacy-popup-confirm"];this.K(this.u,"click",this.A)},q9=function(a){g.W.call(this,{B:"div",
G:"ytp-remote",J:[{B:"div",G:"ytp-remote-display-status",J:[{B:"div",G:"ytp-remote-display-status-icon",J:[g.lP()]},{B:"div",G:"ytp-remote-display-status-text",T:"{{statustext}}"}]}]});this.l=new g.WP(this,250);g.G(this,this.l);this.o=a;this.K(a,"presentingplayerstatechange",this.u);p9(this,g.ZJ(a))},p9=function(a,b){if(3==a.o.getPresentingPlayerType()){var c={RECEIVER_NAME:a.o.getOption("remote","currentReceiver").name};
c=g.U(b,128)?g.kN("No se ha podido reproducir el v\u00eddeo en $RECEIVER_NAME",c):g.rC(b)||g.U(b,4)?g.kN("El v\u00eddeo se est\u00e1 reproduciendo en $RECEIVER_NAME",c):g.kN("Conectado a $RECEIVER_NAME",c);a.updateValue("statustext",c);a.l.show()}else a.l.hide()},r9=function(a,b){g.GT.call(this,"Reproducir en",0,a,b);
this.l=a;this.F={};this.K(a,"onMdxReceiversChange",this.I);this.K(a,"presentingplayerstatechange",this.I);this.I()},s9=function(a){g.BK.call(this,a);
this.i={key:E5(),name:"Este ordenador"};this.u=null;this.o=[];this.C=this.g=null;this.A=[this.i];this.l=this.i;this.pk=new g.kC(64);this.H=0;this.Mm=-1;if(!g.Ty(g.X(this.player))){a=this.player;var b=g.eD(a);b&&(b=b.fn())&&(b=new r9(a,b),g.G(this,b));b=new q9(a);g.G(this,b);g.nK(a,b.element,4);this.F=new o9;g.G(this,this.F);g.nK(a,this.F.element,4);this.D=!!R8()}},n9=function(a,b,c){a.pk=c;
a.player.N("presentingplayerstatechange",new g.vD(c,b))},t9=function(a,b){if(b.key!=a.l.key)if(b.key==a.i.key)X8();
else{var c;if(c=g.Q(g.X(a.player).experiments,"mdx_enable_privacy_disclosure"))c=g.Cp("PLAYER_CONFIG"),c=!(c&&c.args&&void 0!==c.args.authuser||g.Cp("SESSION_INDEX")||g.Cp("LOGGED_IN"));c&&!a.D&&(a.player.pauseVideo(),a.F.l.show(),V8()||(d9=!0));a.l=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);var e=c.videoId;if(d||e){var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.oa(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,
playerParams:c.playerParams,clickTrackingParams:c.Ef,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=r5(c))&&(d.locationInfo=c);c=d}else c=null;O8("Connecting to: "+g.Lg(b));"cast-selector-receiver"==b.key?(Q8(c||null),d8()?X7().setLaunchParams(c||null):U7("setLaunchParams called before ready.")):!c&&$8()&&N8()==b.key?w5("yt-remote-connection-change",!0):(X8(),Q8(c||null),c=M8().Id(),(c=G5(c,b.key))&&Y8(c,1))}},fqa=/^https?$/i,gra=["POST",
"PUT"];g.y(p5,g.Tf);g.h=p5.prototype;
g.h.send=function(a,b,c,d){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+a);b=b?b.toUpperCase():"GET";this.D=a;this.l="";this.u=0;this.aa=b;this.O=!1;this.i=!0;this.g=this.M?h5(this.M):h5(g.FY);this.P=this.M?this.M.getOptions():g.FY.getOptions();this.g.onreadystatechange=(0,g.x)(this.jw,this);try{e5(i5(this,"Opening Xhr")),this.W=!0,this.g.open(b,String(a),!0),this.W=!1}catch(f){e5(i5(this,"Error opening Xhr: "+f.message));m5(this,f);return}a=c||
"";var e=this.headers.clone();d&&cqa(d,function(f,k){e.set(k,f)});
d=g.Ya(e.Hd(),dqa);c=g.v.FormData&&a instanceof g.v.FormData;!g.ab(gra,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,k){this.g.setRequestHeader(k,f)},this);
this.Z&&(this.g.responseType=this.Z);"withCredentials"in this.g&&this.g.withCredentials!==this.R&&(this.g.withCredentials=this.R);try{j5(this),0<this.A&&(this.I=eqa(this.g),e5(i5(this,"Will abort after "+this.A+"ms if incomplete, xhr2 "+this.I)),this.I?(this.g.timeout=this.A,this.g.ontimeout=(0,g.x)(this.kw,this)):this.F=g.Hg(this.kw,this.A,this)),e5(i5(this,"Sending request")),this.C=!0,this.g.send(a),this.C=!1}catch(f){e5(i5(this,"Send error: "+f.message)),m5(this,f)}};
g.h.kw=function(){"undefined"!=typeof g.kY&&this.g&&(this.l="Timed out after "+this.A+"ms, aborting",this.u=8,i5(this,this.l),this.dispatchEvent("timeout"),this.abort(8))};
g.h.abort=function(a){this.g&&this.i&&(i5(this,"Aborting"),this.i=!1,this.o=!0,this.g.abort(),this.o=!1,this.u=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),l5(this))};
g.h.U=function(){this.g&&(this.i&&(this.i=!1,this.o=!0,this.g.abort(),this.o=!1),l5(this,!0));p5.Xa.U.call(this)};
g.h.jw=function(){this.ea()||(this.W||this.C||this.o?o5(this):this.wK())};
g.h.wK=function(){o5(this)};
g.h.isActive=function(){return!!this.g};
g.h.getStatus=function(){try{return 2<n5(this)?this.g.status:-1}catch(a){return-1}};
g.h.getLastError=function(){return g.Fa(this.l)?this.l:String(this.l)};
var n6={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"<"},m6={"'":"\\'"},hra={};g.h=v5.prototype;g.h.isEmpty=function(){return 0==this.g.length&&0==this.i.length};
g.h.clear=function(){this.g=[];this.i=[]};
g.h.contains=function(a){return g.ab(this.g,a)||g.ab(this.i,a)};
g.h.remove=function(a){var b=this.g;var c=(0,g.Nma)(b,a);0<=c?(g.cb(b,c),b=!0):b=!1;return b||g.db(this.i,a)};
g.h.zc=function(){for(var a=[],b=this.g.length-1;0<=b;--b)a.push(this.g[b]);var c=this.i.length;for(b=0;b<c;++b)a.push(this.i[b]);return a};
var nqa={JN:"atp",UP:"ska",JP:"que",jP:"mus",TP:"sus",AO:"dsp",QP:"seq"};x5.prototype.jg=function(){var a=new x5({id:this.id,name:this.name,app:this.app,type:this.type,user:this.username,userAvatarUri:this.avatar,obfuscatedGaiaId:this.obfuscatedGaiaId,theme:this.theme,capabilities:Array.from(this.capabilities.values()).join(","),experiments:Array.from(this.experiments.values()).join(",")});a.l=this.l;a.i=this.i;a.g=this.g};
var R5,K5="",vqa=T5("loadCastFramework")||T5("loadCastApplicationFramework"),Oqa=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.y(Z5,g.D);g.h=Z5.prototype;g.h.oD=function(a){this.o=arguments;this.g=!1;this.za?this.l=(0,g.H)()+this.Wc:this.za=g.Hg(this.u,this.Wc)};
g.h.stop=function(){this.za&&(g.v.clearTimeout(this.za),this.za=null);this.l=null;this.g=!1;this.o=[]};
g.h.pause=function(){++this.i};
g.h.resume=function(){this.i&&(--this.i,!this.i&&this.g&&(this.g=!1,this.A.apply(null,this.o)))};
g.h.U=function(){this.stop();Z5.Xa.U.call(this)};
g.h.pD=function(){this.l?(this.za=g.Hg(this.u,this.l-(0,g.H)()),this.l=null):(this.za=null,this.i?this.g=!0:(this.g=!1,this.A.apply(null,this.o)))};$5.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)};
$5.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};g.h=a6.prototype;g.h.eh=null;g.h.xe=!1;g.h.Yi=null;g.h.lt=null;g.h.Hi=null;g.h.Yh=null;g.h.Zf=null;g.h.Gg=null;g.h.vh=null;g.h.tc=null;g.h.ll=0;g.h.Ce=null;g.h.oo=null;g.h.rg=null;g.h.Vj=-1;g.h.fA=!0;g.h.Rg=!1;g.h.eq=0;g.h.Jn=null;var h6={},f6={};g.h=a6.prototype;g.h.setTimeout=function(a){this.o=a};
g.h.eM=function(a){a=a.target;var b=this.Jn;b&&3==n5(a)?b.Rj():this.nB(a)};
g.h.nB=function(a){try{if(a==this.tc)a:{var b=n5(this.tc),c=this.tc.u,d=this.tc.getStatus();if(g.Md&&!g.pd(10)||g.Od&&!g.od("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Dh&&!q5(this.tc))break a;this.Rg||4!=b||7==c||(8==c||0>=d?this.g.te(3):this.g.te(2));r6(this);var e=this.tc.getStatus();this.Vj=e;var f=q5(this.tc);(this.xe=200==e)?(4==b&&j6(this),this.u?(l6(this,b,f),g.Dh&&this.xe&&3==b&&(this.ba.ca(this.i,"tick",this.YL),this.i.start())):i6(this,f),this.xe&&!this.Rg&&(4==b?this.g.wn(this):(this.xe=
!1,e6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.rg=3,g6(13)):(this.rg=0,g6(14)),j6(this),k6(this))}}catch(k){this.tc&&q5(this.tc)}finally{}};
g.h.YL=function(){var a=n5(this.tc),b=q5(this.tc);this.ll<b.length&&(r6(this),l6(this,a,b),this.xe&&4!=a&&e6(this))};
g.h.wL=function(a){q6((0,g.x)(this.vL,this,a),0)};
g.h.vL=function(a){this.Rg||(r6(this),i6(this,a),e6(this))};
g.h.iz=function(a){q6((0,g.x)(this.uL,this,a),0)};
g.h.uL=function(a){this.Rg||(j6(this),this.xe=a,this.g.wn(this),this.g.te(4))};
g.h.cancel=function(){this.Rg=!0;j6(this)};
g.h.GL=function(){this.Yi=null;var a=(0,g.H)();0<=a-this.lt?(2!=this.Yh&&this.g.te(3),j6(this),this.rg=2,g6(18),k6(this)):p6(this,this.lt-a)};
g.h.getLastError=function(){return this.rg};g.h=v6.prototype;g.h.bq=null;g.h.Cd=null;g.h.Kn=!1;g.h.iw=null;g.h.gm=null;g.h.Oq=null;g.h.cq=null;g.h.de=null;g.h.Bf=-1;g.h.Uj=null;g.h.mj=null;g.h.connect=function(a){this.cq=a;a=w6(this.g,null,this.cq);g6(3);this.iw=(0,g.H)();var b=this.g.D;null!=b?(this.Uj=b[0],(this.mj=b[1])?(this.de=1,x6(this)):(this.de=2,z6(this))):(g5(a,"MODE","init"),this.Cd=new a6(this,void 0,void 0,void 0),this.Cd.eh=this.bq,d6(this.Cd,a,!1,null,!0),this.de=0)};
g.h.vC=function(a){if(a)this.de=2,z6(this);else{g6(4);var b=this.g;b.Ke=b.hg.Bf;T6(b,9)}a&&this.te(2)};
g.h.Ap=function(a){return this.g.Ap(a)};
g.h.abort=function(){this.Cd&&(this.Cd.cancel(),this.Cd=null);this.Bf=-1};
g.h.hw=function(){return!1};
g.h.cz=function(a,b){this.Bf=a.Vj;if(0==this.de)if(b){try{var c=this.i.parse(b)}catch(d){c=this.g;c.Ke=this.Bf;T6(c,2);return}this.Uj=c[0];this.mj=c[1]}else c=this.g,c.Ke=this.Bf,T6(c,2);else if(2==this.de)if(this.Kn)g6(7),this.Oq=(0,g.H)();else if("11111"==b){if(g6(6),this.Kn=!0,this.gm=(0,g.H)(),c=this.gm-this.iw,!g.Md||g.pd(10)||500>c)this.Bf=200,this.Cd.cancel(),g6(12),y6(this.g,this,!0)}else g6(8),this.gm=this.Oq=(0,g.H)(),this.Kn=!1};
g.h.wn=function(){this.Bf=this.Cd.Vj;if(this.Cd.xe)0==this.de?this.mj?(this.de=1,x6(this)):(this.de=2,z6(this)):2==this.de&&((!g.Md||g.pd(10)?!this.Kn:200>this.Oq-this.gm)?(g6(11),y6(this.g,this,!1)):(g6(12),y6(this.g,this,!0)));else{0==this.de?g6(9):2==this.de&&g6(10);var a=this.g;this.Cd.getLastError();a.Ke=this.Bf;T6(a,2)}};
g.h.Tk=function(){return this.g.Tk()};
g.h.isActive=function(){return this.g.isActive()};
g.h.te=function(a){this.g.te(a)};g.h=A6.prototype;g.h.zj=null;g.h.yd=null;g.h.Tb=null;g.h.Zp=null;g.h.im=null;g.h.yu=null;g.h.tm=null;g.h.Bk=0;g.h.MH=0;g.h.Tc=null;g.h.ng=null;g.h.rf=null;g.h.Wg=null;g.h.hg=null;g.h.mo=null;g.h.li=-1;g.h.Pw=-1;g.h.Ke=-1;g.h.Sh=0;g.h.Kh=0;g.h.Sg=8;var U6=new g.Tf;g.y(B6,g.tf);g.y(C6,g.tf);g.y(D6,g.tf);g.h=A6.prototype;g.h.connect=function(a,b,c,d,e){g6(0);this.Zp=b;this.zj=c||{};d&&g.Ea(e)&&(this.zj.OSID=d,this.zj.OAID=e);this.A?(q6((0,g.x)(this.Ru,this,a),100),J6(this)):this.Ru(a)};
g.h.Ru=function(a){this.hg=new v6(this);this.hg.bq=null;this.hg.i=this.u;this.hg.connect(a)};
g.h.hw=function(){return 0==this.g};
g.h.hz=function(a){this.ng=null;O6(this,a)};
g.h.gz=function(){this.rf=null;this.Tb=new a6(this,this.l,"rpc",this.C);this.Tb.eh=null;this.Tb.eq=0;var a=this.yu.clone();g.Xm(a,"RID","rpc");g.Xm(a,"SID",this.l);g.Xm(a,"CI",this.mo?"0":"1");g.Xm(a,"AID",this.li);F6(this,a);if(!g.Md||g.pd(10))g.Xm(a,"TYPE","xmlhttp"),d6(this.Tb,a,!0,this.tm,!1);else{g.Xm(a,"TYPE","html");var b=this.Tb,c=!!this.tm;b.Yh=3;b.Zf=f5(a.clone());o6(b,c)}};
g.h.cz=function(a,b){if(0!=this.g&&(this.Tb==a||this.yd==a))if(this.Ke=a.Vj,this.yd==a&&3==this.g)if(7<this.Sg){try{var c=this.u.parse(b)}catch(f){c=null}if(g.Ma(c)&&3==c.length)if(0==c[0])a:{if(!this.rf){if(this.Tb)if(this.Tb.Hi+3E3<this.yd.Hi)K6(this),this.Tb.cancel(),this.Tb=null;else break a;R6(this);g6(19)}}else this.Pw=c[1],0<this.Pw-this.li&&37500>c[2]&&this.mo&&0==this.Kh&&!this.Wg&&(this.Wg=q6((0,g.x)(this.oI,this),6E3));else T6(this,11)}else b!=hra.fO.g&&T6(this,11);else if(this.Tb==a&&
K6(this),!g.xb(b)){c=this.u.parse(b);g.Ma(c);for(var d=0;d<c.length;d++){var e=c[d];this.li=e[0];e=e[1];2==this.g?"c"==e[0]?(this.l=e[1],this.tm=e[2],e=e[3],null!=e?this.Sg=e:this.Sg=6,this.g=3,this.Tc&&this.Tc.Lu(),this.yu=w6(this,this.Tk()?this.tm:null,this.Zp),P6(this)):"stop"==e[0]&&T6(this,7):3==this.g&&("stop"==e[0]?T6(this,7):"noop"!=e[0]&&this.Tc&&this.Tc.Ku(e),this.Kh=0)}}};
g.h.oI=function(){null!=this.Wg&&(this.Wg=null,this.Tb.cancel(),this.Tb=null,R6(this),g6(20))};
g.h.wn=function(a){if(this.Tb==a){K6(this);this.Tb=null;var b=2}else if(this.yd==a)this.yd=null,b=1;else return;this.Ke=a.Vj;if(0!=this.g)if(a.xe)1==b?(b=(0,g.H)()-a.Hi,U6.dispatchEvent(new C6(U6,a.vh?a.vh.length:0,b,this.Sh)),I6(this),this.o.length=0):P6(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.Ke)){if(d=1==b)this.yd||this.ng||1==this.g||2<=this.Sh?d=!1:(this.ng=q6((0,g.x)(this.hz,this,a),Q6(this,this.Sh)),this.Sh++,d=!0);d=!(d||2==b&&R6(this))}if(d)switch(c){case 1:T6(this,
5);break;case 4:T6(this,10);break;case 3:T6(this,6);break;case 7:T6(this,12);break;default:T6(this,2)}}};
g.h.OC=function(a){if(!g.ab(arguments,this.g))throw Error("Unexpected channel state: "+this.g);};
g.h.IM=function(a){a?g6(2):(g6(1),S6(this,8))};
g.h.Ap=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new p5;a.R=!1;return a};
g.h.isActive=function(){return!!this.Tc&&this.Tc.isActive(this)};
g.h.te=function(a){U6.dispatchEvent(new D6(U6,a))};
g.h.Tk=function(){return!(!g.Md||g.pd(10))};
g.h=V6.prototype;g.h.Lu=function(){};
g.h.Ku=function(){};
g.h.Ju=function(){};
g.h.mp=function(){};
g.h.Hv=function(){return{}};
g.h.isActive=function(){return!0};g.y(W6,g.D);g.h=W6.prototype;g.h.oL=function(){this.Wc=Math.min(3E5,2*this.Wc);this.l();this.i&&this.start()};
g.h.start=function(){var a=this.Wc+15E3*Math.random();g.eo(this.g,a);this.i=(0,g.H)()+a};
g.h.stop=function(){this.g.stop();this.i=0};
g.h.isActive=function(){return this.g.isActive()};
g.h.reset=function(){this.g.stop();this.Wc=5E3};g.y(X6,V6);g.h=X6.prototype;g.h.subscribe=function(a,b,c){return this.l.subscribe(a,b,c)};
g.h.unsubscribe=function(a,b,c){return this.l.unsubscribe(a,b,c)};
g.h.Lf=function(a){return this.l.fh(a)};
g.h.N=function(a,b){return this.l.N.apply(this.l,arguments)};
g.h.dispose=function(){this.fb||(this.fb=!0,g.rf(this.l),Y6(this),g.rf(this.i),this.i=null)};
g.h.ea=function(){return this.fb};
g.h.connect=function(a,b,c){if(!this.g||2!=this.g.g){this.F="";this.i.stop();this.u=a||null;this.o=b||0;a=this.H+"/test";b=this.H+"/bind";var d=new A6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.I),e=this.g;e&&(e.Tc=null);d.Tc=this;this.g=d;e?this.g.connect(a,b,this.A,e.l,e.li):c?this.g.connect(a,b,this.A,c.sessionId,c.arrayId):this.g.connect(a,b,this.A)}};
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.fc(c,b);this.i.isActive()||2==(this.g?this.g.g:0)?this.C.push(c):Z6(this)&&L6(this.g,c)};
g.h.Lu=function(){this.i.reset();this.u=null;this.o=0;if(this.C.length){var a=this.C;this.C=[];for(var b=0,c=a.length;b<c;++b)L6(this.g,a[b])}this.N("handlerOpened")};
g.h.Ju=function(a){var b=2==a&&401==this.g.Ke;4==a||b||this.i.start();this.N("handlerError",a)};
g.h.mp=function(a){if(!this.i.isActive())this.N("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.C.push(d)}};
g.h.Hv=function(){var a={v:2};this.F&&(a.gsessionid=this.F);0!=this.o&&(a.ui=""+this.o);0!=this.D&&(a.ui=""+this.D);this.u&&g.fc(a,this.u);return a};
g.h.Ku=function(a){"S"==a[0]?this.F=a[1]:"gracefulReconnect"==a[0]?(this.i.start(),H6(this.g)):this.N("handlerMessage",new zqa(a[0],a[1]))};
g.h.nM=function(){this.i.isActive();var a=this.g,b=0;a.Tb&&b++;a.yd&&b++;0==b&&this.connect(this.u,this.o)};$6.prototype.o=function(a,b,c,d){b?a(d):a({text:c.responseText})};
$6.prototype.l=function(a,b){a(Error("Request error: "+b.status))};
$6.prototype.u=function(a){a(Error("request timed out"))};var Fqa=(0,g.H)(),e7=null,i7=Array(50),h7=-1,j7=!1;g.y(k7,g.P);k7.prototype.Id=function(){return this.g};
k7.prototype.contains=function(a){return!!F5(this.g,a)};
k7.prototype.get=function(a){return a?G5(this.g,a):null};
k7.prototype.info=function(a){g7(this.C,a)};g.t(m7,g.P);g.h=m7.prototype;g.h.start=function(){!this.g&&isNaN(this.za)&&this.qB()};
g.h.stop=function(){this.g&&(this.g.abort(),this.g=null);isNaN(this.za)||(g.Mp(this.za),this.za=NaN)};
g.h.U=function(){this.stop();g.P.prototype.U.call(this)};
g.h.qB=function(){this.za=NaN;this.g=g.Hq(a7(this.A,"/pairing/get_screen"),{method:"POST",ub:{pairing_code:this.u},timeout:5E3,onSuccess:(0,g.x)(this.jN,this),onError:(0,g.x)(this.iN,this),ie:(0,g.x)(this.kN,this)})};
g.h.jN=function(a,b){this.g=null;var c=b.screen||{};c.dialId=this.l;c.name=this.o;this.N("pairingComplete",new y5(c))};
g.h.iN=function(a){this.g=null;a.status&&404==a.status?this.i>=u9.length?this.N("pairingFailed",Error("DIAL polling timed out")):(a=u9[this.i],this.za=g.Kp((0,g.x)(this.qB,this),a),this.i++):this.N("pairingFailed",Error("Server error "+a.status))};
g.h.kN=function(){this.g=null;this.N("pairingFailed",Error("Server not responding"))};
var u9=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.y(o7,k7);g.h=o7.prototype;g.h.start=function(){n7(this)&&this.N("screenChange");!g.it("yt-remote-lounge-token-expiration")&&p7(this);g.Mp(this.i);this.i=g.Kp((0,g.x)(this.start,this),1E4)};
g.h.add=function(a,b){n7(this);l7(this,a);q7(this,!1);this.N("screenChange");b(a);a.token||p7(this)};
g.h.remove=function(a,b){var c=n7(this);Hqa(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.N("screenChange")};
g.h.ho=function(a,b,c,d){var e=n7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,q7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.N("screenChange")};
g.h.U=function(){g.Mp(this.i);o7.Xa.U.call(this)};
g.h.zD=function(a){n7(this);var b=this.g.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}q7(this,!b);b&&g7(this.C,"Missed "+b+" lounge tokens.")};
g.h.yD=function(a){g7(this.C,"Requesting lounge tokens failed: "+a)};g.t(s7,g.P);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.it("yt-remote-fast-check-period")||"0",10);(this.o=(0,g.H)()-144E5<a?0:a)?v7(this):(this.o=(0,g.H)()+3E5,g.ht("yt-remote-fast-check-period",this.o),this.rs())};
g.h.isEmpty=function(){return g.Yb(this.g)};
g.h.update=function(){r7("Updating availability on schedule.");var a=this.A(),b=g.Mb(this.g,function(c,d){return c&&!!G5(a,d)},this);
u7(this,b)};
g.h.U=function(){g.Mp(this.l);this.l=NaN;this.i&&(this.i.abort(),this.i=null);g.P.prototype.U.call(this)};
g.h.rs=function(){g.Mp(this.l);this.l=NaN;this.i&&this.i.abort();var a=w7(this);if(s5(a)){var b=a7(this.u,"/pairing/get_screen_availability");this.i=b7(this.u,b,{lounge_token:g.Sb(a).join(",")},(0,g.x)(this.SK,this,a),(0,g.x)(this.RK,this))}else u7(this,{}),v7(this)};
g.h.SK=function(a,b){this.i=null;var c=g.Sb(w7(this));if(g.sb(c,g.Sb(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;u7(this,d);v7(this)}else this.Hb("Changing Screen set during request."),this.rs()};
g.h.RK=function(a){this.Hb("Screen availability failed: "+a);this.i=null;v7(this)};
g.h.Hb=function(a){g7("OnlineScreenService",a)};g.y(x7,k7);g.h=x7.prototype;g.h.start=function(){this.l.start();this.i.start();this.g.length&&(this.N("screenChange"),this.i.isEmpty()||this.N("onlineScreenChange"))};
g.h.add=function(a,b,c){this.l.add(a,b,c)};
g.h.remove=function(a,b,c){this.l.remove(a,b,c);this.i.update()};
g.h.ho=function(a,b,c,d){this.l.contains(a)?this.l.ho(a,b,c,d):(a="Updating name of unknown screen: "+a.name,g7(this.C,a),d(Error(a)))};
g.h.Id=function(a){return a?this.g:g.fb(this.g,(0,g.Yd)(this.o,function(b){return!this.contains(b)},this))};
g.h.rB=function(){return(0,g.Yd)(this.Id(!0),function(a){return!!this.i.g[a.id]},this)};
g.h.sB=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new m7(this.A,a,b,c);f.subscribe("pairingComplete",(0,g.x)(function(k){g.rf(f);d(y7(this,k))},this));
f.subscribe("pairingFailed",function(k){g.rf(f);e(k)});
f.start();return(0,g.x)(f.stop,f)};
g.h.mN=function(a,b,c,d){g.Hq(a7(this.A,"/pairing/get_screen"),{method:"POST",ub:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new y5(f.screen||{});if(!k.name||A7(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);A7(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(y7(this,k))},this),
onError:(0,g.x)(function(e){d(Error("pairing request failed: "+e.status))},this),
ie:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})};
g.h.U=function(){g.rf(this.l);g.rf(this.i);x7.Xa.U.call(this)};
g.h.HD=function(){B7(this);this.N("screenChange");this.i.update()};
x7.prototype.dispose=x7.prototype.dispose;g.y(D7,g.P);g.h=D7.prototype;g.h.yn=function(a){this.l=a;this.N("sessionScreen",this.l)};
g.h.Md=function(a){this.ea()||(a&&E7(this,""+a),this.l=null,this.N("sessionScreen",null))};
g.h.info=function(a){g7(this.P,a)};
g.h.uB=function(){return null};
g.h.Ds=function(a){var b=this.i;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.x)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.x)(function(){E7(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.h.U=function(){this.Ds("");D7.Xa.U.call(this)};g.y(G7,D7);g.h=G7.prototype;g.h.Cs=function(a){if(this.g){if(this.g==a)return;E7(this,"Overriding cast sesison with new session object");this.g.removeUpdateListener(this.A);this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u)}this.g=a;this.g.addUpdateListener(this.A);this.g.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.u);Lqa(this)};
g.h.ni=function(a){this.info("launchWithParams no-op for Cast: "+g.Lg(a))};
g.h.stop=function(){this.g?this.g.stop((0,g.x)(function(){this.Md()},this),(0,g.x)(function(){this.Md(Error("Failed to stop receiver app."))},this)):this.Md(Error("Stopping cast device witout session."))};
g.h.Ds=g.Ja;g.h.U=function(){this.info("disposeInternal");g.Mp(this.o);this.o=0;this.g&&(this.g.removeUpdateListener(this.A),this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u));this.g=null;G7.Xa.U.call(this)};
g.h.RL=function(a,b){if(!this.ea())if(b){var c=u5(b);if(g.Pa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Lg(c));switch(d){case "mdxSessionStatus":F7(this,c.screenId);break;default:E7(this,"Unknown youtube message: "+d)}}else E7(this,"Unable to parse message.")}else E7(this,"No data in message.")};
g.h.Xv=function(a,b,c,d){z7(this.F,this.i.label,a,this.i.friendlyName,(0,g.x)(function(e){e?b(e):0<=d?(E7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Kp((0,g.x)(this.Xv,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.uB=function(){return this.g};
g.h.nN=function(a){this.ea()||a||(E7(this,"Cast session died."),this.Md())};g.y(H7,D7);g.h=H7.prototype;g.h.Cs=function(a){this.o=a;this.o.addUpdateListener(this.I)};
g.h.ni=function(a){this.u=a;this.C()};
g.h.stop=function(){this.g();this.g=g.Ja;g.Mp(this.A);this.o?this.o.stop((0,g.x)(this.Md,this,null),(0,g.x)(this.Md,this,"Failed to stop DIAL device.")):this.Md()};
g.h.U=function(){this.g();this.g=g.Ja;g.Mp(this.A);this.o&&this.o.removeUpdateListener(this.I);this.o=null;H7.Xa.U.call(this)};
g.h.qN=function(a){this.ea()||a||(E7(this,"DIAL session died."),this.g(),this.g=g.Ja,this.Md())};
g.h.rq=function(a){this.H=E5();if(this.u){var b=new chrome.cast.DialLaunchResponse(!0,J7(this));a(b);I7(this)}else this.C=(0,g.x)(function(){g.Mp(this.A);this.C=g.Ja;this.A=NaN;var c=new chrome.cast.DialLaunchResponse(!0,J7(this));a(c);I7(this)},this),this.A=g.Kp((0,g.x)(function(){this.C()},this),100)};
g.h.cE=function(a,b,c){z7(this.F,this.D.receiver.label,a,this.i.friendlyName,(0,g.x)(function(d){d&&d.token?(this.yn(d),b(new chrome.cast.DialLaunchResponse(!1))):this.rq(b,c)},this),(0,g.x)(function(d){E7(this,"Failed to get DIAL screen: "+d);
this.rq(b,c)},this))};g.y(K7,D7);K7.prototype.stop=function(){this.Md()};
K7.prototype.Cs=g.Ja;K7.prototype.ni=function(){g.Mp(this.g);this.g=NaN;var a=G5(this.F.Id(),this.i.label);a?this.yn(a):this.Md(Error("No such screen"))};
K7.prototype.U=function(){g.Mp(this.g);this.g=NaN;K7.Xa.U.call(this)};g.y(L7,g.P);g.h=L7.prototype;
g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.C);this.D||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,f=(0,g.x)(this.BK,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.ez,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.QI,this);chrome.cast.initialize(c,(0,g.x)(function(){this.ea()||
(chrome.cast.addReceiverActionListener(this.o),Cqa(),this.i.subscribe("onlineScreenChange",(0,g.x)(this.tB,this)),this.l=Q7(this),chrome.cast.setCustomReceivers(this.l,g.Ja,(0,g.x)(function(k){this.Hb("Failed to set initial custom receivers: "+g.Lg(k))},this)),this.N("yt-remote-cast2-availability-change",O7(this)),b(!0))},this),(0,g.x)(function(k){this.Hb("Failed to initialize API: "+g.Lg(k));
b(!1)},this))};
g.h.wM=function(a,b){N7("Setting connected screen ID: "+a+" -> "+b);if(this.g){var c=this.g.l;if(!a||c&&c.id!=a)N7("Unsetting old screen status: "+this.g.i.friendlyName),P7(this,null)}if(a&&b){if(!this.g){c=G5(this.i.Id(),a);if(!c){N7("setConnectedScreenStatus: Unknown screen.");return}var d=M7(this,c);d||(N7("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.l.push(d),chrome.cast.setCustomReceivers(this.l,
g.Ja,(0,g.x)(function(e){this.Hb("Failed to set initial custom receivers: "+g.Lg(e))},this)));
N7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);P7(this,new K7(this.i,d),!0)}this.g.Ds(b)}else N7("setConnectedScreenStatus: no screen.")};
g.h.xM=function(a){this.ea()?this.Hb("Setting connection data on disposed cast v2"):this.g?this.g.ni(a):this.Hb("Setting connection data without a session")};
g.h.pN=function(){this.ea()?this.Hb("Stopping session on disposed cast v2"):this.g?(this.g.stop(),P7(this,null)):N7("Stopping non-existing session")};
g.h.requestSession=function(){chrome.cast.requestSession((0,g.x)(this.ez,this),(0,g.x)(this.XK,this))};
g.h.U=function(){this.i.unsubscribe("onlineScreenChange",(0,g.x)(this.tB,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.o);g.db(g.w("yt.mdx.remote.debug.handlers_")||[],c7);g.rf(this.g);L7.Xa.U.call(this)};
g.h.Hb=function(a){g7("Controller",a)};
g.h.fz=function(a,b){this.g==a&&(b||P7(this,null),this.N("yt-remote-cast2-session-change",b))};
g.h.xK=function(a,b){if(!this.ea())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),N7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.g)if(this.g.i.label!=a.label)N7("onReceiverAction_: Stopping active receiver: "+this.g.i.friendlyName),this.g.stop();else{N7("onReceiverAction_: Casting to active receiver.");this.g.l&&this.N("yt-remote-cast2-session-change",this.g.l);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:P7(this,
new K7(this.i,a));break;case chrome.cast.ReceiverType.DIAL:P7(this,new H7(this.i,a,this.A));break;case chrome.cast.ReceiverType.CAST:P7(this,new G7(this.i,a));break;default:this.Hb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.g&&this.g.i.label==a.label?this.g.stop():this.Hb("Stopping receiver w/o session: "+a.friendlyName)}else this.Hb("onReceiverAction_ called without receiver.")};
g.h.QI=function(a){if(this.ea())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Hb("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.g?this.g.i:null;if(!c||c.label!=b.label)return this.Hb("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.g.l)return N7("Reselecting dial screen."),
this.N("yt-remote-cast2-session-change",this.g.l),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Hb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);P7(this,new H7(this.i,b,this.A))}b=this.g;b.D=a;return b.D.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.x)(b.cE,b,(b.D.extraData||{}).screenId||null)):new Promise((0,g.x)(b.rq,b))};
g.h.ez=function(a){if(!this.ea()){N7("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.g)if(b.receiverType==chrome.cast.ReceiverType.CAST)N7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),P7(this,new G7(this.i,b),!0);else{this.Hb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.g.i,d=G5(this.i.Id(),c.label);d&&z5(d,b.label)&&
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(N7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.rf(this.g),this.g=new G7(this.i,b),this.g.subscribe("sessionScreen",(0,g.x)(this.fz,this,this.g)),this.g.ni(null));this.g.Cs(a)}}};
g.h.oN=function(){return this.g?this.g.uB():null};
g.h.XK=function(a){this.ea()||(this.Hb("Failed to estabilish a session: "+g.Lg(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&P7(this,null))};
g.h.BK=function(a){N7("Receiver availability updated: "+a);if(!this.ea()){var b=O7(this);this.u=a==chrome.cast.ReceiverAvailability.AVAILABLE;O7(this)!=b&&this.N("yt-remote-cast2-availability-change",O7(this))}};
g.h.tB=function(){this.ea()||(this.l=Q7(this),N7("Updating custom receivers: "+g.Lg(this.l)),chrome.cast.setCustomReceivers(this.l,g.Ja,(0,g.x)(function(){this.Hb("Failed to set custom receivers.")},this)),this.N("yt-remote-cast2-availability-change",O7(this)))};
L7.prototype.setLaunchParams=L7.prototype.xM;L7.prototype.setConnectedScreenStatus=L7.prototype.wM;L7.prototype.stopSession=L7.prototype.pN;L7.prototype.getCastSession=L7.prototype.oN;L7.prototype.requestSession=L7.prototype.requestSession;L7.prototype.init=L7.prototype.init;L7.prototype.dispose=L7.prototype.dispose;var Z7=[];g8.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";h8(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.g=a.trackData,this.Le=a.hasPrevious,this.hasNext=a.hasNext,this.C=a.playerTime,this.A=a.playerTimeAt,this.o=a.seekableStart,this.i=a.seekableEnd,this.D=a.duration,this.F=a.loadedTime,this.l=a.liveIngestionTime,this.u=
!isNaN(this.l))};
g8.prototype.isAdPlaying=function(){return 1081==this.playerState};
g8.prototype.getDuration=function(){return this.u?this.D+i8(this):this.D};
g8.prototype.clone=function(){return new g8(m8(this))};g.t(p8,g.P);g.h=p8.prototype;g.h.play=function(){1==this.g?(this.i?this.i.play(null,g.Ja,x8(this,"play")):v8(this,"play"),u8(this,1,k8(q8(this))),this.N("remotePlayerChange")):s8(this,this.play)};
g.h.pause=function(){1==this.g?(this.i?this.i.pause(null,g.Ja,x8(this,"pause")):v8(this,"pause"),u8(this,2,k8(q8(this))),this.N("remotePlayerChange")):s8(this,this.pause)};
g.h.seekTo=function(a){if(1==this.g){if(this.i){var b=q8(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.playerState||3==b.playerState?chrome.cast.media.ResumeState.PLAYBACK_START:chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.i.seek(c,g.Ja,x8(this,"seekTo",{newTime:a}))}else v8(this,"seekTo",{newTime:a});u8(this,3,a);this.N("remotePlayerChange")}else s8(this,g.Sa(this.seekTo,a))};
g.h.stop=function(){if(1==this.g){this.i?this.i.stop(null,g.Ja,x8(this,"stopVideo")):v8(this,"stopVideo");var a=q8(this);a.index=-1;a.videoId="";h8(a);t8(this,a);this.N("remotePlayerChange")}else s8(this,this.stop)};
g.h.setVolume=function(a,b){if(1==this.g){var c=q8(this);if(this.l){if(c.volume!=a){var d=Math.round(a)/100;this.l.setReceiverVolumeLevel(d,(0,g.x)(function(){g7("CP","set receiver volume: "+d)},this),(0,g.x)(function(){this.Hb("failed to set receiver volume.")},this))}c.muted!=b&&this.l.setReceiverMuted(b,(0,g.x)(function(){g7("CP","set receiver muted: "+b)},this),(0,g.x)(function(){this.Hb("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);v8(this,"setVolume",e)}c.muted=b;c.volume=a;t8(this,c)}else s8(this,g.Sa(this.setVolume,a,b))};
g.h.sA=function(a,b){if(1==this.g){var c=q8(this),d={videoId:a};b&&(c.g={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Lg(b.style),g.fc(d,c.g));v8(this,"setSubtitlesTrack",d);t8(this,c)}else s8(this,g.Sa(this.sA,a,b))};
g.h.setAudioTrack=function(a,b){if(1==this.g){var c=b.getLanguageInfo().getId();v8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=q8(this);d.audioTrackId=c;t8(this,d)}else s8(this,g.Sa(this.setAudioTrack,a,b))};
g.h.playVideo=function(a,b,c,d,e,f,k){var l=q8(this);c=c||0;var m={videoId:a,currentIndex:c};l8(l,a,c);g.Ea(b)&&(j8(l,b),m.currentTime=b);g.Ea(d)&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.Lg(k));v8(this,"setPlaylist",m);d||t8(this,l)};
g.h.Fn=function(a,b){if(1==this.g){if(a&&b){var c=q8(this);l8(c,a,b);t8(this,c)}v8(this,"previous")}else s8(this,g.Sa(this.Fn,a,b))};
g.h.nextVideo=function(a,b){if(1==this.g){if(a&&b){var c=q8(this);l8(c,a,b);t8(this,c)}v8(this,"next")}else s8(this,g.Sa(this.nextVideo,a,b))};
g.h.jv=function(){1==this.g?v8(this,"dismissAutoplay"):s8(this,this.jv)};
g.h.dispose=function(){if(3!=this.g){var a=this.g;this.g=3;this.N("proxyStateChange",a,this.g)}g.P.prototype.dispose.call(this)};
g.h.U=function(){r8(this);this.o=null;this.u.clear();o8(this,null);g.P.prototype.U.call(this)};
g.h.ot=function(a){if((a!=this.g||2==a)&&3!=this.g&&0!=a){var b=this.g;this.g=a;this.N("proxyStateChange",b,a);if(1==a)for(;!this.u.isEmpty();)b=a=this.u,0==b.g.length&&(b.g=b.i,b.g.reverse(),b.i=[]),a.g.pop().apply(this);else 3==a&&this.dispose()}};
g.h.uK=function(a,b){this.N(a,b)};
g.h.uI=function(a){if(!a)this.Ek(null),o8(this,null);else if(this.l.receiver.volume){a=this.l.receiver.volume;var b=q8(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)g7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,t8(this,b)}};
g.h.Ek=function(a){g7("CP","Cast media: "+!!a);this.i&&this.i.removeUpdateListener(this.D);if(this.i=a)this.i.addUpdateListener(this.D),w8(this),this.N("remotePlayerChange")};
g.h.tI=function(a){a?(w8(this),this.N("remotePlayerChange")):this.Ek(null)};
g.h.Us=function(){v8(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.II=function(){var a=c8();a&&o8(this,a)};
g.h.Hb=function(a){g7("CP",a)};g.t(y8,g.P);g.h=y8.prototype;
g.h.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,k=b.index,l={videoId:d},m=b.currentTime,n=b.locationInfo;g.Ea(m)&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);g.Ea(k)&&(l.currentIndex=k);c&&(this.Na.listId=c);this.Na.videoId=d;this.Na.index=k||0;this.Na.state=3;j8(this.Na,m);this.o="UNSUPPORTED";z8("Connecting with setPlaylist and params: "+g.Lg(l));this.g.connect({method:"setPlaylist",
params:g.Lg(l)},a,N5())}else z8("Connecting without params"),this.g.connect({},a,N5());Sqa(this)};
g.h.dispose=function(){this.ea()||(this.N("beforeDispose"),A8(this,3));g.P.prototype.dispose.call(this)};
g.h.U=function(){B8(this);D8(this);C8(this);g.Mp(this.C);this.C=NaN;g.Mp(this.D);this.D=NaN;this.l=null;g.Qr(this.P);this.P.length=0;this.g.dispose();g.P.prototype.U.call(this);this.o=this.A=this.i=this.Na=this.g=null};
g.h.sD=function(){this.Ph(2)};
g.h.yI=function(){z8("Channel opened");this.I&&(this.I=!1,C8(this),this.H=g.Kp((0,g.x)(function(){z8("Timing out waiting for a screen.");this.Ph(1)},this),15E3));
tqa(Aqa(this.g),this.M)};
g.h.vI=function(){z8("Channel closed");isNaN(this.u)?Q5(!0):Q5();this.dispose()};
g.h.wI=function(a){Q5();isNaN(this.Jj())?(z8("Channel error: "+a+" without reconnection"),this.dispose()):(this.I=!0,z8("Channel error: "+a+" with reconnection in "+this.Jj()+" ms"),A8(this,2))};
g.h.xI=function(a){a.params?z8("Received: action="+a.action+", params="+g.Lg(a.params)):z8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=u5(a.params.devices);this.i=(0,g.B)(a,function(c){return new x5(c)});
a=!!g.Ya(this.i,function(c){return"LOUNGE_SCREEN"==c.type});
G8(this,a);break;case "loungeScreenDisconnected":g.eb(this.i,function(c){return"LOUNGE_SCREEN"==c.type});
G8(this,!1);break;case "remoteConnected":var b=new x5(u5(a.params.device));g.Ya(this.i,function(c){return b?c.id==b.id:!1})||iqa(this.i,b);
break;case "remoteDisconnected":b=new x5(u5(a.params.device));g.eb(this.i,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":H8(this,a);break;case "nowPlaying":Vqa(this,a);break;case "onStateChange":I8(this,a);break;case "onAdStateChange":Wqa(this,a);break;case "onVolumeChanged":Xqa(this,a);break;case "onSubtitlesTrackChanged":Uqa(this,a);break;case "nowAutoplaying":Yqa(this,a);break;case "autoplayDismissed":this.N("autoplayDismissed");break;case "autoplayUpNext":this.A=a.params.videoId||null;this.N("autoplayUpNext",this.A);break;case "onAutoplayModeChanged":this.o=
a.params.autoplayMode;this.N("autoplayModeChange",this.o);"DISABLED"==this.o&&this.N("autoplayDismissed");break;case "onHasPreviousNextChanged":Zqa(this,a);break;case "requestAssistedSignIn":this.N("assistedSignInRequested",a.params.authCode);break;default:z8("Unrecognized action: "+a.action)}};
g.h.kM=function(){if(this.l){var a=this.l;this.l=null;this.Na.videoId!=a&&E8(this,"getNowPlaying")}};
g.h.iD=function(){var a=3;this.ea()||(a=0,isNaN(this.Jj())?Z6(this.g)&&isNaN(this.u)&&(a=1):a=2);return a};
g.h.Ph=function(a){z8("Disconnecting with "+a);B8(this);this.N("beforeDisconnect",a);1==a&&Q5();Y6(this.g,a);this.dispose()};
g.h.hD=function(){var a=this.Na;this.l&&(a=this.Na.clone(),l8(a,this.l,a.index));return m8(a)};
g.h.yM=function(a){var b=new g8(a);b.videoId&&b.videoId!=this.Na.videoId&&(this.l=b.videoId,g.Mp(this.C),this.C=g.Kp((0,g.x)(this.kM,this),5E3));var c=[];this.Na.listId==b.listId&&this.Na.videoId==b.videoId&&this.Na.index==b.index||c.push("remoteQueueChange");this.Na.playerState==b.playerState&&this.Na.volume==b.volume&&this.Na.muted==b.muted&&k8(this.Na)==k8(b)&&g.Lg(this.Na.g)==g.Lg(b.g)||c.push("remotePlayerChange");this.Na.reset(a);(0,g.z)(c,function(d){this.N(d)},this)};
g.h.Uv=function(){var a=this.g.A.id,b=g.Ya(this.i,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.h.Jj=function(){var a=this.g;return a.i.isActive()?a.i.i-(0,g.H)():NaN};
g.h.aD=function(){return this.o||"UNSUPPORTED"};
g.h.bD=function(){return this.A||""};
g.h.hN=function(){if(!isNaN(this.Jj())){var a=this.g.i;g.fo(a.g);a.start()}};
g.h.rM=function(a,b){E8(this,a,b);F8(this)};
y8.prototype.subscribe=y8.prototype.subscribe;y8.prototype.unsubscribeByKey=y8.prototype.Lf;y8.prototype.getProxyState=y8.prototype.iD;y8.prototype.disconnect=y8.prototype.Ph;y8.prototype.getPlayerContextData=y8.prototype.hD;y8.prototype.setPlayerContextData=y8.prototype.yM;y8.prototype.getOtherConnectedRemoteId=y8.prototype.Uv;y8.prototype.getReconnectTimeout=y8.prototype.Jj;y8.prototype.getAutoplayMode=y8.prototype.aD;y8.prototype.getAutoplayVideoId=y8.prototype.bD;y8.prototype.reconnect=y8.prototype.hN;
y8.prototype.sendMessage=y8.prototype.rM;g.t(J8,k7);g.h=J8.prototype;g.h.Id=function(a){return this.Vc.$_gs(a)};
g.h.contains=function(a){return!!this.Vc.$_c(a)};
g.h.get=function(a){return this.Vc.$_g(a)};
g.h.start=function(){this.Vc.$_st()};
g.h.add=function(a,b,c){this.Vc.$_a(a,b,c)};
g.h.remove=function(a,b,c){this.Vc.$_r(a,b,c)};
g.h.ho=function(a,b,c,d){this.Vc.$_un(a,b,c,d)};
g.h.U=function(){for(var a=0,b=this.i.length;a<b;++a)this.Vc.$_ubk(this.i[a]);this.i.length=0;this.Vc=null;k7.prototype.U.call(this)};
g.h.lN=function(){this.N("screenChange")};
g.h.ZJ=function(){this.N("onlineScreenChange")};
x7.prototype.$_st=x7.prototype.start;x7.prototype.$_gspc=x7.prototype.mN;x7.prototype.$_gsppc=x7.prototype.sB;x7.prototype.$_c=x7.prototype.contains;x7.prototype.$_g=x7.prototype.get;x7.prototype.$_a=x7.prototype.add;x7.prototype.$_un=x7.prototype.ho;x7.prototype.$_r=x7.prototype.remove;x7.prototype.$_gs=x7.prototype.Id;x7.prototype.$_gos=x7.prototype.rB;x7.prototype.$_s=x7.prototype.subscribe;x7.prototype.$_ubk=x7.prototype.Lf;var e9=null,d9=!1,K8=null,L8=null,a9=null,P8=[];g.t(f9,g.D);g.h=f9.prototype;
g.h.U=function(){g.D.prototype.U.call(this);this.o.stop();this.A.stop();this.I.stop();this.M();this.g.unsubscribe("proxyStateChange",this.bz,this);this.g.unsubscribe("remotePlayerChange",this.Gk,this);this.g.unsubscribe("remoteQueueChange",this.zn,this);this.g.unsubscribe("autoplayUpNext",this.Fy,this);this.g.unsubscribe("previousNextChange",this.Yy,this);this.g.unsubscribe("nowAutoplaying",this.Uy,this);this.g.unsubscribe("autoplayDismissed",this.Ey,this);this.g=this.u=null};
g.h.Bx=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.g.g)if(j9(this)){if(!q8(this.g).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==q8(this.g).playerState?this.g.pause():this.g.play();break;case "control_play":this.g.play();break;case "control_pause":this.g.pause();break;case "control_seek":this.H.Rj(c[0],c[1]);break;case "control_subtitles_set_track":k9(this,c[0]);break;case "control_set_audio_track":c=c[0],j9(this)&&this.g.setAudioTrack(this.i.getVideoData(1).videoId,
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.i.getCurrentTime();l9(this,0==c?void 0:c);break;case "control_seek":l9(this,c[0]);break;case "control_subtitles_set_track":k9(this,c[0]);break;case "control_set_audio_track":c=c[0],j9(this)&&this.g.setAudioTrack(this.i.getVideoData(1).videoId,c)}};
g.h.sI=function(a){this.I.oD(a)};
g.h.SM=function(a){this.Bx("control_subtitles_set_track",g.Yb(a)?null:a)};
g.h.FA=function(){var a=this.i.getOption("captions","track");g.Yb(a)||k9(this,a)};
g.h.Qy=function(a){if(j9(this)){this.g.unsubscribe("remotePlayerChange",this.Gk,this);var b=Math.round(a.volume);a=!!a.muted;var c=q8(this.g);if(b!=c.volume||a!=c.muted)this.g.setVolume(b,a),this.P.start();this.g.subscribe("remotePlayerChange",this.Gk,this)}};
g.h.tJ=function(){g.Yb(this.C)||m9(this,this.C);this.D=!1};
g.h.bz=function(a,b){this.A.stop();2==b&&this.EA()};
g.h.Gk=function(){if(j9(this)){this.o.stop();var a=q8(this.g);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.u.Mm=1;break;case 1082:case 1083:this.u.Mm=0;break;default:this.u.Mm=-1}switch(a.playerState){case 1081:case 1:h9(this,new g.kC(8));this.DA();break;case 1085:case 3:h9(this,new g.kC(9));break;case 1083:case 0:h9(this,new g.kC(2));this.H.stop();g9(this,this.i.getVideoData().lengthSeconds);break;case 1084:h9(this,new g.kC(4));break;case 2:h9(this,new g.kC(4));g9(this,k8(a));
break;case -1:h9(this,new g.kC(64));break;case -1E3:h9(this,new g.kC(128,{errorCode:"mdx.remoteerror",message:"Este v\u00eddeo no se puede reproducir de forma remota."}))}a=q8(this.g).g;var b=this.C;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.C=a,m9(this,a));a=q8(this.g);-1==a.volume||Math.round(this.i.getVolume())==a.volume&&this.i.isMuted()==a.muted||this.P.isActive()||this.eB()}else i9(this)};
g.h.Yy=function(){this.i.N("mdxpreviousnextchange")};
g.h.zn=function(){j9(this)||i9(this)};
g.h.uC=function(){this.g.jv()};
g.h.Fy=function(a){a&&(a=g.Hq("/watch_queue_ajax",{method:"GET",Dc:{action_get_watch_queue_item:1,video_id:a},onSuccess:(0,g.x)(this.zL,this)}))&&(this.M=(0,g.x)(a.abort,a))};
g.h.zL=function(a,b){var c=new g.XA(g.X(this.i),{videoId:b.videoId,title:b.title,author:b.author,murlmq_webp:b.url});this.suggestion=c;this.i.N("mdxautoplayupnext",c)};
g.h.Uy=function(a){isNaN(a)||this.i.N("mdxnowautoplaying",a)};
g.h.Ey=function(){this.i.N("mdxautoplaycanceled")};
g.h.PF=function(a,b){-1==q8(this.g).playerState?l9(this,a):b&&this.g.seekTo(a)};
g.h.eB=function(){if(j9(this)){var a=q8(this.g);this.l.Ka(this.O);a.muted?this.i.mute():this.i.unMute();this.i.setVolume(a.volume);this.O=this.l.K(this.i,"onVolumeChange",this.Qy)}};
g.h.DA=function(){this.o.stop();if(!this.g.ea()){var a=q8(this.g);1==a.playerState&&h9(this,new g.kC(8));g9(this,k8(a));this.o.start()}};
g.h.EA=function(){this.A.stop();this.o.stop();var a=this.g.o.getReconnectTimeout();2==this.g.g&&!isNaN(a)&&this.A.start()};g.t(o9,g.W);o9.prototype.o=function(){w5("mdx-privacy-popup-cancel");this.l.hide()};
o9.prototype.A=function(){w5("mdx-privacy-popup-confirm");this.l.hide()};g.t(q9,g.W);q9.prototype.u=function(a){p9(this,a.state)};g.t(r9,g.GT);r9.prototype.I=function(){var a=this.l.getOption("remote","receivers");a&&1<a.length&&!this.l.getOption("remote","quickCast")?(this.F=g.ub(a,this.A,this),g.HT(this,(0,g.B)(a,this.A)),a=this.l.getOption("remote","currentReceiver"),this.se(this.A(a)),this.enable(!0)):this.enable(!1)};
r9.prototype.A=function(a){return a.key};
r9.prototype.re=function(a){return"cast-selector-receiver"==a?"Reparto...":this.F[a].name};
r9.prototype.Ic=function(a){g.GT.prototype.Ic.call(this,a);this.l.setOption("remote","currentReceiver",this.F[a]);this.o.ib()};g.t(s9,g.BK);g.h=s9.prototype;
g.h.create=function(){dra(g.Hy(g.X(this.player)));this.o.push(g.Rp("yt-remote-before-disconnect",this.pI,this));this.o.push(g.Rp("yt-remote-connection-change",this.CK,this));this.o.push(g.Rp("yt-remote-receiver-availability-change",this.Zy,this));this.o.push(g.Rp("yt-remote-auto-connect",this.AK,this));this.o.push(g.Rp("yt-remote-receiver-resumed",this.zK,this));this.o.push(g.Rp("mdx-privacy-popup-confirm",this.bM,this));this.o.push(g.Rp("mdx-privacy-popup-cancel",this.aM,this));this.Zy()};
g.h.load=function(){this.player.cancelPlayback();g.BK.prototype.load.call(this);this.u=new f9(this,this.player,this.g);var a=(a=c9())?a.currentTime:0;var b=$8()?new p8(V8(),void 0):null;0==a&&b&&(a=k8(q8(b)));0!=a&&this.Kc(a);n9(this,this.pk,this.pk);g.GX(this.player.app,6)};
g.h.unload=function(){this.player.N("mdxautoplaycanceled");this.l=this.i;g.sf(this.u,this.g);this.g=this.u=null;g.BK.prototype.unload.call(this);g.GX(this.player.app,5)};
g.h.U=function(){g.Sp(this.o);g.BK.prototype.U.call(this)};
g.h.af=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.u.Bx.apply(this.u,[a].concat(g.fa(c)))};
g.h.getAdState=function(){return this.Mm};
g.h.kD=function(){return this.loaded?this.u.suggestion:null};
g.h.Le=function(){return this.g?q8(this.g).Le:!1};
g.h.hasNext=function(){return this.g?q8(this.g).hasNext:!1};
g.h.Kc=function(a,b){this.H=a||0;this.player.N("progresssync",a,b)};
g.h.getCurrentTime=function(){return this.H};
g.h.getProgressState=function(){var a=q8(this.g),b=this.player.getVideoData();return{allowSeeking:g.Q(g.X(this.player).experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.dc():!a.isAdPlaying()&&this.player.dc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.u?a.l+i8(a):a.l,isAtLiveHead:1>=(a.u?a.i+i8(a):a.i)-this.getCurrentTime(),loaded:a.F,seekableEnd:a.u?a.i+i8(a):a.i,seekableStart:0<a.o?a.o+
i8(a):a.o}};
g.h.nextVideo=function(){this.g&&this.g.nextVideo()};
g.h.Fn=function(){this.g&&this.g.Fn()};
g.h.pI=function(a){1==a&&(this.C=this.g?q8(this.g):null)};
g.h.CK=function(){var a=$8()?new p8(V8(),void 0):null;if(a){var b=this.l;this.loaded&&this.unload();this.g=a;this.C=null;b.key!=this.i.key&&(this.l=b,this.load())}else g.rf(this.g),this.g=null,this.loaded&&(this.unload(),(a=this.C)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,k8(a)));this.player.N("videodatachange","newdata",this.player.getVideoData(),3)};
g.h.Zy=function(){this.A=[this.i].concat(era());var a=W8()||this.i;t9(this,a);this.player.la("onMdxReceiversChange")};
g.h.AK=function(){var a=W8();t9(this,a)};
g.h.zK=function(){this.l=W8()};
g.h.bM=function(){this.D=!0;d9=!1;e9&&Y8(e9,1);e9=null};
g.h.aM=function(){this.D=!1;t9(this,this.i);this.l=this.i;d9=!1;e9=null;this.player.playVideo()};
g.h.xc=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.A;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?e8():t9(this,b)),this.loaded?this.l:this.i;case "quickCast":return 2==this.A.length&&"cast-selector-receiver"==this.A[1].key?(b&&e8(),!0):!1}};
g.h.Us=function(){this.g.Us()};
g.h.Lb=function(){return!1};
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.XU.remote=s9;})(_yt_player);
